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