Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines a set of user experience metrics data recorded by | 5 // This file defines a set of user experience metrics data recorded by |
| 6 // the MetricsService. This is the unit of data that is sent to the server. | 6 // the MetricsService. This is the unit of data that is sent to the server. |
| 7 | 7 |
| 8 #ifndef COMPONENTS_METRICS_METRICS_LOG_H_ | 8 #ifndef COMPONENTS_METRICS_METRICS_LOG_H_ |
| 9 #define COMPONENTS_METRICS_METRICS_LOG_H_ | 9 #define COMPONENTS_METRICS_METRICS_LOG_H_ |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 // January 1, 1970 GMT. | 67 // January 1, 1970 GMT. |
| 68 // The value is used to identify when a new build is run, so that previous | 68 // The value is used to identify when a new build is run, so that previous |
| 69 // reliability stats, from other builds, can be abandoned. | 69 // reliability stats, from other builds, can be abandoned. |
| 70 static int64_t GetBuildTime(); | 70 static int64_t GetBuildTime(); |
| 71 | 71 |
| 72 // Convenience function to return the current time at a resolution in seconds. | 72 // Convenience function to return the current time at a resolution in seconds. |
| 73 // This wraps base::TimeTicks, and hence provides an abstract time that is | 73 // This wraps base::TimeTicks, and hence provides an abstract time that is |
| 74 // always incrementing for use in measuring time durations. | 74 // always incrementing for use in measuring time durations. |
| 75 static int64_t GetCurrentTime(); | 75 static int64_t GetCurrentTime(); |
| 76 | 76 |
| 77 static void RecordCoreSystemProfile(MetricsServiceClient* client, | |
|
Alexei Svitkine (slow)
2017/01/27 21:11:56
Nit: Comment.
rkaplow
2017/01/27 21:57:36
Done.
| |
| 78 SystemProfileProto* system_profile); | |
| 79 | |
| 77 // Records a user-initiated action. | 80 // Records a user-initiated action. |
| 78 void RecordUserAction(const std::string& key); | 81 void RecordUserAction(const std::string& key); |
| 79 | 82 |
| 80 // Record any changes in a given histogram for transmission. | 83 // Record any changes in a given histogram for transmission. |
| 81 void RecordHistogramDelta(const std::string& histogram_name, | 84 void RecordHistogramDelta(const std::string& histogram_name, |
| 82 const base::HistogramSamples& snapshot); | 85 const base::HistogramSamples& snapshot); |
| 83 | 86 |
| 87 | |
| 88 // TODO(rkaplow): I think this can be a little refactored as it currently | |
| 89 // records a pretty arbitrary set of things. | |
| 84 // Records the current operating environment, including metrics provided by | 90 // Records the current operating environment, including metrics provided by |
| 85 // the specified set of |metrics_providers|. Takes the list of synthetic | 91 // the specified set of |metrics_providers|. Takes the list of synthetic |
| 86 // trial IDs as a parameter. A synthetic trial is one that is set up | 92 // trial IDs as a parameter. A synthetic trial is one that is set up |
| 87 // dynamically by code in Chrome. For example, a pref may be mapped to a | 93 // dynamically by code in Chrome. For example, a pref may be mapped to a |
| 88 // synthetic trial such that the group is determined by the pref value. The | 94 // synthetic trial such that the group is determined by the pref value. The |
| 89 // current environment is returned serialized as a string. | 95 // current environment is returned serialized as a string. |
| 90 std::string RecordEnvironment( | 96 std::string RecordEnvironment( |
| 91 const std::vector<MetricsProvider*>& metrics_providers, | 97 const std::vector<MetricsProvider*>& metrics_providers, |
| 92 const std::vector<variations::ActiveGroupId>& synthetic_trials, | 98 const std::vector<variations::ActiveGroupId>& synthetic_trials, |
| 93 int64_t install_date, | 99 int64_t install_date, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 const base::TimeTicks creation_time_; | 200 const base::TimeTicks creation_time_; |
| 195 | 201 |
| 196 PrefService* local_state_; | 202 PrefService* local_state_; |
| 197 | 203 |
| 198 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 204 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
| 199 }; | 205 }; |
| 200 | 206 |
| 201 } // namespace metrics | 207 } // namespace metrics |
| 202 | 208 |
| 203 #endif // COMPONENTS_METRICS_METRICS_LOG_H_ | 209 #endif // COMPONENTS_METRICS_METRICS_LOG_H_ |
| OLD | NEW |