| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 // The delay, in seconds, after starting recording before doing expensive | 229 // The delay, in seconds, after starting recording before doing expensive |
| 230 // initialization work. | 230 // initialization work. |
| 231 static const int kInitializationDelaySeconds = 30; | 231 static const int kInitializationDelaySeconds = 30; |
| 232 | 232 |
| 233 // This specifies the amount of time to wait for all renderers to send their | 233 // This specifies the amount of time to wait for all renderers to send their |
| 234 // data. | 234 // data. |
| 235 static const int kMaxHistogramGatheringWaitDuration = 60000; // 60 seconds. | 235 static const int kMaxHistogramGatheringWaitDuration = 60000; // 60 seconds. |
| 236 | 236 |
| 237 // The maximum number of events in a log uploaded to the UMA server. | 237 // The maximum number of events in a log uploaded to the UMA server. |
| 238 // TBD(jar): hack test to NOT send any events, to see if this helps reduce | 238 static const int kEventLimit = 2400; |
| 239 // the number of bloated logs. | |
| 240 static const int kEventLimit = 0; | |
| 241 | 239 |
| 242 // If an upload fails, and the transmission was over this byte count, then we | 240 // If an upload fails, and the transmission was over this byte count, then we |
| 243 // will discard the log, and not try to retransmit it. We also don't persist | 241 // will discard the log, and not try to retransmit it. We also don't persist |
| 244 // the log to the prefs for transmission during the next chrome session if this | 242 // the log to the prefs for transmission during the next chrome session if this |
| 245 // limit is exceeded. | 243 // limit is exceeded. |
| 246 static const int kUploadLogAvoidRetransmitSize = 50000; | 244 static const int kUploadLogAvoidRetransmitSize = 50000; |
| 247 | 245 |
| 248 // Interval, in seconds, between state saves. | 246 // Interval, in seconds, between state saves. |
| 249 static const int kSaveStateInterval = 5 * 60; // five minutes | 247 static const int kSaveStateInterval = 5 * 60; // five minutes |
| 250 | 248 |
| (...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 if (local_state) { | 1748 if (local_state) { |
| 1751 const PrefService::Preference* uma_pref = | 1749 const PrefService::Preference* uma_pref = |
| 1752 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1750 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
| 1753 if (uma_pref) { | 1751 if (uma_pref) { |
| 1754 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1752 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
| 1755 DCHECK(success); | 1753 DCHECK(success); |
| 1756 } | 1754 } |
| 1757 } | 1755 } |
| 1758 return result; | 1756 return result; |
| 1759 } | 1757 } |
| OLD | NEW |