| 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 // Record core profile settings into the SystemProfileProto. |
| 78 static void RecordCoreSystemProfile(MetricsServiceClient* client, |
| 79 SystemProfileProto* system_profile); |
| 80 |
| 77 // Records a user-initiated action. | 81 // Records a user-initiated action. |
| 78 void RecordUserAction(const std::string& key); | 82 void RecordUserAction(const std::string& key); |
| 79 | 83 |
| 80 // Record any changes in a given histogram for transmission. | 84 // Record any changes in a given histogram for transmission. |
| 81 void RecordHistogramDelta(const std::string& histogram_name, | 85 void RecordHistogramDelta(const std::string& histogram_name, |
| 82 const base::HistogramSamples& snapshot); | 86 const base::HistogramSamples& snapshot); |
| 83 | 87 |
| 88 |
| 89 // TODO(rkaplow): I think this can be a little refactored as it currently |
| 90 // records a pretty arbitrary set of things. |
| 84 // Records the current operating environment, including metrics provided by | 91 // Records the current operating environment, including metrics provided by |
| 85 // the specified set of |metrics_providers|. Takes the list of synthetic | 92 // 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 | 93 // 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 | 94 // 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 | 95 // synthetic trial such that the group is determined by the pref value. The |
| 89 // current environment is returned serialized as a string. | 96 // current environment is returned serialized as a string. |
| 90 std::string RecordEnvironment( | 97 std::string RecordEnvironment( |
| 91 const std::vector<MetricsProvider*>& metrics_providers, | 98 const std::vector<MetricsProvider*>& metrics_providers, |
| 92 const std::vector<variations::ActiveGroupId>& synthetic_trials, | 99 const std::vector<variations::ActiveGroupId>& synthetic_trials, |
| 93 int64_t install_date, | 100 int64_t install_date, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 const base::TimeTicks creation_time_; | 201 const base::TimeTicks creation_time_; |
| 195 | 202 |
| 196 PrefService* local_state_; | 203 PrefService* local_state_; |
| 197 | 204 |
| 198 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 205 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
| 199 }; | 206 }; |
| 200 | 207 |
| 201 } // namespace metrics | 208 } // namespace metrics |
| 202 | 209 |
| 203 #endif // COMPONENTS_METRICS_METRICS_LOG_H_ | 210 #endif // COMPONENTS_METRICS_METRICS_LOG_H_ |
| OLD | NEW |