OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
9 #define CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Get the amount of uptime in seconds since this function was last called. | 57 // Get the amount of uptime in seconds since this function was last called. |
58 // This updates the cumulative uptime metric for uninstall as a side effect. | 58 // This updates the cumulative uptime metric for uninstall as a side effect. |
59 static int64 GetIncrementalUptime(PrefService* pref); | 59 static int64 GetIncrementalUptime(PrefService* pref); |
60 | 60 |
61 // Get the current version of the application as a string. | 61 // Get the current version of the application as a string. |
62 static std::string GetVersionString(); | 62 static std::string GetVersionString(); |
63 | 63 |
64 virtual MetricsLog* AsMetricsLog(); | 64 virtual MetricsLog* AsMetricsLog(); |
65 | 65 |
66 private: | 66 private: |
| 67 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
| 68 |
67 // Returns the date at which the current metrics client ID was created as | 69 // Returns the date at which the current metrics client ID was created as |
68 // a string containing milliseconds since the epoch, or "0" if none was found. | 70 // a string containing milliseconds since the epoch, or "0" if none was found. |
69 std::string GetInstallDate() const; | 71 std::string GetInstallDate() const; |
70 | 72 |
71 | 73 |
72 // Writes application stability metrics (as part of the profile log). | 74 // Writes application stability metrics (as part of the profile log). |
73 // NOTE: Has the side-effect of clearing those counts. | 75 // NOTE: Has the side-effect of clearing those counts. |
74 void WriteStabilityElement(); | 76 void WriteStabilityElement(PrefService* pref); |
75 | 77 |
76 // Within stability group, write plugin crash stats. | 78 // Within stability group, write plugin crash stats. |
77 void WritePluginStabilityElements(PrefService* pref); | 79 void WritePluginStabilityElements(PrefService* pref); |
78 | 80 |
79 // Within the stability group, write required attributes. | 81 // Within the stability group, write required attributes. |
80 void WriteRequiredStabilityAttributes(PrefService* pref); | 82 void WriteRequiredStabilityAttributes(PrefService* pref); |
81 | 83 |
82 // Within the stability group, write attributes that need to be updated asap | 84 // Within the stability group, write attributes that need to be updated asap |
83 // and can't be delayed until the user decides to restart chromium. | 85 // and can't be delayed until the user decides to restart chromium. |
84 // Delaying these stats would bias metrics away from happy long lived | 86 // Delaying these stats would bias metrics away from happy long lived |
(...skipping 13 matching lines...) Expand all Loading... |
98 | 100 |
99 // Writes metrics for the profile identified by key. This writes all | 101 // Writes metrics for the profile identified by key. This writes all |
100 // key/value pairs in profile_metrics. | 102 // key/value pairs in profile_metrics. |
101 void WriteProfileMetrics(const std::string& key, | 103 void WriteProfileMetrics(const std::string& key, |
102 const DictionaryValue& profile_metrics); | 104 const DictionaryValue& profile_metrics); |
103 | 105 |
104 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 106 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
105 }; | 107 }; |
106 | 108 |
107 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 109 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |