| 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 | 
| 11 | 11 | 
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" | 
| 13 #include "chrome/common/metrics_helpers.h" | 13 #include "chrome/common/metrics_helpers.h" | 
| 14 #include "chrome/common/page_transition_types.h" | 14 #include "chrome/common/page_transition_types.h" | 
|  | 15 #include "webkit/glue/plugins/webplugininfo.h" | 
| 15 | 16 | 
| 16 struct AutocompleteLog; | 17 struct AutocompleteLog; | 
| 17 class DictionaryValue; | 18 class DictionaryValue; | 
| 18 class GURL; | 19 class GURL; | 
| 19 class PrefService; | 20 class PrefService; | 
| 20 | 21 | 
| 21 namespace webkit { |  | 
| 22 namespace npapi { |  | 
| 23 struct WebPluginInfo; |  | 
| 24 } |  | 
| 25 } |  | 
| 26 |  | 
| 27 class MetricsLog : public MetricsLogBase { | 22 class MetricsLog : public MetricsLogBase { | 
| 28  public: | 23  public: | 
| 29   // Creates a new metrics log | 24   // Creates a new metrics log | 
| 30   // client_id is the identifier for this profile on this installation | 25   // client_id is the identifier for this profile on this installation | 
| 31   // session_id is an integer that's incremented on each application launch | 26   // session_id is an integer that's incremented on each application launch | 
| 32   MetricsLog(const std::string& client_id, int session_id); | 27   MetricsLog(const std::string& client_id, int session_id); | 
| 33   virtual ~MetricsLog(); | 28   virtual ~MetricsLog(); | 
| 34 | 29 | 
| 35   static void RegisterPrefs(PrefService* prefs); | 30   static void RegisterPrefs(PrefService* prefs); | 
| 36 | 31 | 
| 37   // Records the current operating environment.  Takes the list of installed | 32   // Records the current operating environment.  Takes the list of installed | 
| 38   // plugins as a parameter because that can't be obtained synchronously | 33   // plugins as a parameter because that can't be obtained synchronously | 
| 39   // from the UI thread. | 34   // from the UI thread. | 
| 40   // profile_metrics, if non-null, gives a dictionary of all profile metrics | 35   // profile_metrics, if non-null, gives a dictionary of all profile metrics | 
| 41   // that are to be recorded. Each value in profile_metrics should be a | 36   // that are to be recorded. Each value in profile_metrics should be a | 
| 42   // dictionary giving the metrics for the profile. | 37   // dictionary giving the metrics for the profile. | 
| 43   void RecordEnvironment( | 38   void RecordEnvironment(const std::vector<WebPluginInfo>& plugin_list, | 
| 44       const std::vector<webkit::npapi::WebPluginInfo>& plugin_list, | 39                          const DictionaryValue* profile_metrics); | 
| 45       const DictionaryValue* profile_metrics); |  | 
| 46 | 40 | 
| 47   // Records the input text, available choices, and selected entry when the | 41   // Records the input text, available choices, and selected entry when the | 
| 48   // user uses the Omnibox to open a URL. | 42   // user uses the Omnibox to open a URL. | 
| 49   void RecordOmniboxOpenedURL(const AutocompleteLog& log); | 43   void RecordOmniboxOpenedURL(const AutocompleteLog& log); | 
| 50 | 44 | 
| 51   // Record recent delta for critical stability metrics.  We can't wait for a | 45   // Record recent delta for critical stability metrics.  We can't wait for a | 
| 52   // restart to gather these, as that delay biases our observation away from | 46   // restart to gather these, as that delay biases our observation away from | 
| 53   // users that run happily for a looooong time.  We send increments with each | 47   // users that run happily for a looooong time.  We send increments with each | 
| 54   // uma log upload, just as we send histogram data. | 48   // uma log upload, just as we send histogram data. | 
| 55   void RecordIncrementalStabilityElements(); | 49   void RecordIncrementalStabilityElements(); | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 79   // Within the stability group, write required attributes. | 73   // Within the stability group, write required attributes. | 
| 80   void WriteRequiredStabilityAttributes(PrefService* pref); | 74   void WriteRequiredStabilityAttributes(PrefService* pref); | 
| 81 | 75 | 
| 82   // Within the stability group, write attributes that need to be updated asap | 76   // 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. | 77   // and can't be delayed until the user decides to restart chromium. | 
| 84   // Delaying these stats would bias metrics away from happy long lived | 78   // Delaying these stats would bias metrics away from happy long lived | 
| 85   // chromium processes (ones that don't crash, and keep on running). | 79   // chromium processes (ones that don't crash, and keep on running). | 
| 86   void WriteRealtimeStabilityAttributes(PrefService* pref); | 80   void WriteRealtimeStabilityAttributes(PrefService* pref); | 
| 87 | 81 | 
| 88   // Writes the list of installed plugins. | 82   // Writes the list of installed plugins. | 
| 89   void WritePluginList( | 83   void WritePluginList(const std::vector<WebPluginInfo>& plugin_list); | 
| 90       const std::vector<webkit::npapi::WebPluginInfo>& plugin_list); |  | 
| 91 | 84 | 
| 92   // Within the profile group, write basic install info including appversion. | 85   // Within the profile group, write basic install info including appversion. | 
| 93   void WriteInstallElement(); | 86   void WriteInstallElement(); | 
| 94 | 87 | 
| 95   // Writes all profile metrics. This invokes WriteProfileMetrics for each key | 88   // Writes all profile metrics. This invokes WriteProfileMetrics for each key | 
| 96   // in all_profiles_metrics that starts with kProfilePrefix. | 89   // in all_profiles_metrics that starts with kProfilePrefix. | 
| 97   void WriteAllProfilesMetrics(const DictionaryValue& all_profiles_metrics); | 90   void WriteAllProfilesMetrics(const DictionaryValue& all_profiles_metrics); | 
| 98 | 91 | 
| 99   // Writes metrics for the profile identified by key. This writes all | 92   // Writes metrics for the profile identified by key. This writes all | 
| 100   // key/value pairs in profile_metrics. | 93   // key/value pairs in profile_metrics. | 
| 101   void WriteProfileMetrics(const std::string& key, | 94   void WriteProfileMetrics(const std::string& key, | 
| 102                            const DictionaryValue& profile_metrics); | 95                            const DictionaryValue& profile_metrics); | 
| 103 | 96 | 
| 104   DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 97   DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 
| 105 }; | 98 }; | 
| 106 | 99 | 
| 107 #endif  // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 100 #endif  // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 
| OLD | NEW | 
|---|