OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_LOG_H__ | 8 #ifndef CHROME_BROWSER_METRICS_LOG_H__ |
9 #define CHROME_BROWSER_METRICS_LOG_H__ | 9 #define CHROME_BROWSER_METRICS_LOG_H__ |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Records a page load. | 51 // Records a page load. |
52 // window_id - the index of the tab in which the load took place | 52 // window_id - the index of the tab in which the load took place |
53 // url - which URL was loaded | 53 // url - which URL was loaded |
54 // origin - what kind of action initiated the load | 54 // origin - what kind of action initiated the load |
55 // load_time - how long it took to load the page | 55 // load_time - how long it took to load the page |
56 void RecordLoadEvent(int window_id, | 56 void RecordLoadEvent(int window_id, |
57 const GURL& url, | 57 const GURL& url, |
58 PageTransition::Type origin, | 58 PageTransition::Type origin, |
59 int session_index, | 59 int session_index, |
60 TimeDelta load_time); | 60 base::TimeDelta load_time); |
61 | 61 |
62 // Records the current operating environment. Takes the list of installed | 62 // Records the current operating environment. Takes the list of installed |
63 // plugins as a parameter because that can't be obtained synchronously | 63 // plugins as a parameter because that can't be obtained synchronously |
64 // from the UI thread. | 64 // from the UI thread. |
65 // profile_metrics, if non-null, gives a dictionary of all profile metrics | 65 // profile_metrics, if non-null, gives a dictionary of all profile metrics |
66 // that are to be recorded. Each value in profile_metrics should be a | 66 // that are to be recorded. Each value in profile_metrics should be a |
67 // dictionary giving the metrics for the profile. | 67 // dictionary giving the metrics for the profile. |
68 void RecordEnvironment(const std::vector<WebPluginInfo>& plugin_list, | 68 void RecordEnvironment(const std::vector<WebPluginInfo>& plugin_list, |
69 const DictionaryValue* profile_metrics); | 69 const DictionaryValue* profile_metrics); |
70 | 70 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // Writes all profile metrics. This invokes WriteProfileMetrics for each key | 156 // Writes all profile metrics. This invokes WriteProfileMetrics for each key |
157 // in all_profiles_metrics that starts with kProfilePrefix. | 157 // in all_profiles_metrics that starts with kProfilePrefix. |
158 void WriteAllProfilesMetrics(const DictionaryValue& all_profiles_metrics); | 158 void WriteAllProfilesMetrics(const DictionaryValue& all_profiles_metrics); |
159 | 159 |
160 // Writes metrics for the profile identified by key. This writes all | 160 // Writes metrics for the profile identified by key. This writes all |
161 // key/value pairs in profile_metrics. | 161 // key/value pairs in profile_metrics. |
162 void WriteProfileMetrics(const std::wstring& key, | 162 void WriteProfileMetrics(const std::wstring& key, |
163 const DictionaryValue& profile_metrics); | 163 const DictionaryValue& profile_metrics); |
164 | 164 |
165 Time start_time_; | 165 base::Time start_time_; |
166 Time end_time_; | 166 base::Time end_time_; |
167 | 167 |
168 std::string client_id_; | 168 std::string client_id_; |
169 std::string session_id_; | 169 std::string session_id_; |
170 | 170 |
171 // locked_ is true when record has been packed up for sending, and should | 171 // locked_ is true when record has been packed up for sending, and should |
172 // no longer be written to. It is only used for sanity checking and is | 172 // no longer be written to. It is only used for sanity checking and is |
173 // not a real lock. | 173 // not a real lock. |
174 bool locked_; | 174 bool locked_; |
175 | 175 |
176 xmlBufferPtr buffer_; | 176 xmlBufferPtr buffer_; |
177 xmlTextWriterPtr writer_; | 177 xmlTextWriterPtr writer_; |
178 int num_events_; // the number of events recorded in this log | 178 int num_events_; // the number of events recorded in this log |
179 | 179 |
180 DISALLOW_EVIL_CONSTRUCTORS(MetricsLog); | 180 DISALLOW_EVIL_CONSTRUCTORS(MetricsLog); |
181 }; | 181 }; |
182 | 182 |
183 #endif // CHROME_BROWSER_METRICS_LOG_H__ | 183 #endif // CHROME_BROWSER_METRICS_LOG_H__ |
184 | 184 |
OLD | NEW |