OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
7 // | 7 // |
8 // OVERVIEW | 8 // OVERVIEW |
9 // | 9 // |
10 // A MetricsService instance is typically created at application startup. It is | 10 // A MetricsService instance is typically created at application startup. It is |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 const int kInitializationDelaySeconds = 30; | 215 const int kInitializationDelaySeconds = 30; |
216 #endif | 216 #endif |
217 | 217 |
218 // The maximum number of events in a log uploaded to the UMA server. | 218 // The maximum number of events in a log uploaded to the UMA server. |
219 const int kEventLimit = 2400; | 219 const int kEventLimit = 2400; |
220 | 220 |
221 // If an upload fails, and the transmission was over this byte count, then we | 221 // If an upload fails, and the transmission was over this byte count, then we |
222 // will discard the log, and not try to retransmit it. We also don't persist | 222 // will discard the log, and not try to retransmit it. We also don't persist |
223 // the log to the prefs for transmission during the next chrome session if this | 223 // the log to the prefs for transmission during the next chrome session if this |
224 // limit is exceeded. | 224 // limit is exceeded. |
225 const size_t kUploadLogAvoidRetransmitSize = 50000; | 225 const size_t kUploadLogAvoidRetransmitSize = 100 * 1000; |
Ilya Sherman
2014/06/17 21:02:48
nit: Do we want 1024 rather than 1000, so that we'
Alexei Svitkine (slow)
2014/06/19 19:28:36
Done.
| |
226 | 226 |
227 // Interval, in minutes, between state saves. | 227 // Interval, in minutes, between state saves. |
228 const int kSaveStateIntervalMinutes = 5; | 228 const int kSaveStateIntervalMinutes = 5; |
229 | 229 |
230 // The metrics server's URL. | 230 // The metrics server's URL. |
231 const char kServerUrl[] = "https://clients4.google.com/uma/v2"; | 231 const char kServerUrl[] = "https://clients4.google.com/uma/v2"; |
232 | 232 |
233 // The MIME type for the uploaded metrics data. | 233 // The MIME type for the uploaded metrics data. |
234 const char kMimeType[] = "application/vnd.chrome.uma"; | 234 const char kMimeType[] = "application/vnd.chrome.uma"; |
235 | 235 |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1197 RecordCurrentState(local_state_); | 1197 RecordCurrentState(local_state_); |
1198 } | 1198 } |
1199 | 1199 |
1200 void MetricsService::RecordCurrentState(PrefService* pref) { | 1200 void MetricsService::RecordCurrentState(PrefService* pref) { |
1201 pref->SetInt64(metrics::prefs::kStabilityLastTimestampSec, | 1201 pref->SetInt64(metrics::prefs::kStabilityLastTimestampSec, |
1202 Time::Now().ToTimeT()); | 1202 Time::Now().ToTimeT()); |
1203 | 1203 |
1204 for (size_t i = 0; i < metrics_providers_.size(); ++i) | 1204 for (size_t i = 0; i < metrics_providers_.size(); ++i) |
1205 metrics_providers_[i]->RecordCurrentState(); | 1205 metrics_providers_[i]->RecordCurrentState(); |
1206 } | 1206 } |
OLD | NEW |