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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 registry->RegisterInt64Pref(metrics::prefs::kStabilityStatsBuildTime, 0); | 293 registry->RegisterInt64Pref(metrics::prefs::kStabilityStatsBuildTime, 0); |
294 registry->RegisterBooleanPref(metrics::prefs::kStabilityExitedCleanly, true); | 294 registry->RegisterBooleanPref(metrics::prefs::kStabilityExitedCleanly, true); |
295 registry->RegisterIntegerPref(metrics::prefs::kStabilityExecutionPhase, | 295 registry->RegisterIntegerPref(metrics::prefs::kStabilityExecutionPhase, |
296 UNINITIALIZED_PHASE); | 296 UNINITIALIZED_PHASE); |
297 registry->RegisterBooleanPref(metrics::prefs::kStabilitySessionEndCompleted, | 297 registry->RegisterBooleanPref(metrics::prefs::kStabilitySessionEndCompleted, |
298 true); | 298 true); |
299 registry->RegisterIntegerPref(metrics::prefs::kMetricsSessionID, -1); | 299 registry->RegisterIntegerPref(metrics::prefs::kMetricsSessionID, -1); |
300 | 300 |
301 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogs); | 301 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogs); |
302 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogs); | 302 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogs); |
| 303 registry->RegisterListPref(metrics::prefs::kMetricsInitialLogsOld); |
| 304 registry->RegisterListPref(metrics::prefs::kMetricsOngoingLogsOld); |
303 | 305 |
304 registry->RegisterInt64Pref(metrics::prefs::kUninstallLaunchCount, 0); | 306 registry->RegisterInt64Pref(metrics::prefs::kUninstallLaunchCount, 0); |
305 registry->RegisterInt64Pref(metrics::prefs::kUninstallMetricsUptimeSec, 0); | 307 registry->RegisterInt64Pref(metrics::prefs::kUninstallMetricsUptimeSec, 0); |
306 } | 308 } |
307 | 309 |
308 MetricsService::MetricsService(metrics::MetricsStateManager* state_manager, | 310 MetricsService::MetricsService(metrics::MetricsStateManager* state_manager, |
309 metrics::MetricsServiceClient* client, | 311 metrics::MetricsServiceClient* client, |
310 PrefService* local_state) | 312 PrefService* local_state) |
311 : log_manager_(local_state, kUploadLogAvoidRetransmitSize), | 313 : log_manager_(local_state, kUploadLogAvoidRetransmitSize), |
312 histogram_snapshot_manager_(this), | 314 histogram_snapshot_manager_(this), |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 RecordCurrentState(local_state_); | 1197 RecordCurrentState(local_state_); |
1196 } | 1198 } |
1197 | 1199 |
1198 void MetricsService::RecordCurrentState(PrefService* pref) { | 1200 void MetricsService::RecordCurrentState(PrefService* pref) { |
1199 pref->SetInt64(metrics::prefs::kStabilityLastTimestampSec, | 1201 pref->SetInt64(metrics::prefs::kStabilityLastTimestampSec, |
1200 Time::Now().ToTimeT()); | 1202 Time::Now().ToTimeT()); |
1201 | 1203 |
1202 for (size_t i = 0; i < metrics_providers_.size(); ++i) | 1204 for (size_t i = 0; i < metrics_providers_.size(); ++i) |
1203 metrics_providers_[i]->RecordCurrentState(); | 1205 metrics_providers_[i]->RecordCurrentState(); |
1204 } | 1206 } |
OLD | NEW |