OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
17 #include "chrome/common/metrics/metrics_log_base.h" | 17 #include "chrome/common/metrics/metrics_log_base.h" |
18 #include "content/public/common/process_type.h" | |
19 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
20 | 19 |
21 struct AutocompleteLog; | 20 struct AutocompleteLog; |
22 class PrefService; | 21 class PrefService; |
23 | 22 |
24 namespace base { | 23 namespace base { |
25 class DictionaryValue; | 24 class DictionaryValue; |
26 } | 25 } |
27 | 26 |
28 namespace tracked_objects { | |
29 struct ProcessDataSnapshot; | |
30 } | |
31 | |
32 namespace webkit { | 27 namespace webkit { |
33 struct WebPluginInfo; | 28 struct WebPluginInfo; |
34 } | 29 } |
35 | 30 |
36 class MetricsLog : public MetricsLogBase { | 31 class MetricsLog : public MetricsLogBase { |
37 public: | 32 public: |
38 // Creates a new metrics log | 33 // Creates a new metrics log |
39 // client_id is the identifier for this profile on this installation | 34 // client_id is the identifier for this profile on this installation |
40 // session_id is an integer that's incremented on each application launch | 35 // session_id is an integer that's incremented on each application launch |
41 MetricsLog(const std::string& client_id, int session_id); | 36 MetricsLog(const std::string& client_id, int session_id); |
(...skipping 28 matching lines...) Expand all Loading... |
70 // the UI thread. This is exposed as a separate method from the | 65 // the UI thread. This is exposed as a separate method from the |
71 // |RecordEnvironment()| method above because we record the environment with | 66 // |RecordEnvironment()| method above because we record the environment with |
72 // *each* protobuf upload, but only with the initial XML upload. | 67 // *each* protobuf upload, but only with the initial XML upload. |
73 void RecordEnvironmentProto( | 68 void RecordEnvironmentProto( |
74 const std::vector<webkit::WebPluginInfo>& plugin_list); | 69 const std::vector<webkit::WebPluginInfo>& plugin_list); |
75 | 70 |
76 // Records the input text, available choices, and selected entry when the | 71 // Records the input text, available choices, and selected entry when the |
77 // user uses the Omnibox to open a URL. | 72 // user uses the Omnibox to open a URL. |
78 void RecordOmniboxOpenedURL(const AutocompleteLog& log); | 73 void RecordOmniboxOpenedURL(const AutocompleteLog& log); |
79 | 74 |
80 // Records the passed profiled data, which should be a snapshot of the | |
81 // browser's profiled performance during startup for a single process. | |
82 void RecordProfilerData( | |
83 const tracked_objects::ProcessDataSnapshot& process_data, | |
84 content::ProcessType process_type); | |
85 | |
86 // Record recent delta for critical stability metrics. We can't wait for a | 75 // Record recent delta for critical stability metrics. We can't wait for a |
87 // restart to gather these, as that delay biases our observation away from | 76 // restart to gather these, as that delay biases our observation away from |
88 // users that run happily for a looooong time. We send increments with each | 77 // users that run happily for a looooong time. We send increments with each |
89 // uma log upload, just as we send histogram data. Takes the list of | 78 // uma log upload, just as we send histogram data. Takes the list of |
90 // installed plugins as a parameter because that can't be obtained | 79 // installed plugins as a parameter because that can't be obtained |
91 // synchronously from the UI thread. | 80 // synchronously from the UI thread. |
92 void RecordIncrementalStabilityElements( | 81 void RecordIncrementalStabilityElements( |
93 const std::vector<webkit::WebPluginInfo>& plugin_list); | 82 const std::vector<webkit::WebPluginInfo>& plugin_list); |
94 | 83 |
95 protected: | 84 protected: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 137 |
149 // Writes metrics for the profile identified by key. This writes all | 138 // Writes metrics for the profile identified by key. This writes all |
150 // key/value pairs in profile_metrics. | 139 // key/value pairs in profile_metrics. |
151 void WriteProfileMetrics(const std::string& key, | 140 void WriteProfileMetrics(const std::string& key, |
152 const base::DictionaryValue& profile_metrics); | 141 const base::DictionaryValue& profile_metrics); |
153 | 142 |
154 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 143 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
155 }; | 144 }; |
156 | 145 |
157 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 146 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |