Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: chrome/browser/metrics/metrics_log.cc

Issue 293393010: Move initial metrics gathering tasks out of MetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/metrics/metrics_log.h" 5 #include "chrome/browser/metrics/metrics_log.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 PrefService* pref, 294 PrefService* pref,
295 base::TimeDelta incremental_uptime, 295 base::TimeDelta incremental_uptime,
296 base::TimeDelta uptime) { 296 base::TimeDelta uptime) {
297 // Update the stats which are critical for real-time stability monitoring. 297 // Update the stats which are critical for real-time stability monitoring.
298 // Since these are "optional," only list ones that are non-zero, as the counts 298 // Since these are "optional," only list ones that are non-zero, as the counts
299 // are aggregated (summed) server side. 299 // are aggregated (summed) server side.
300 300
301 SystemProfileProto::Stability* stability = 301 SystemProfileProto::Stability* stability =
302 uma_proto()->mutable_system_profile()->mutable_stability(); 302 uma_proto()->mutable_system_profile()->mutable_stability();
303 303
304 int count = pref->GetInteger(prefs::kStabilityChildProcessCrashCount);
305 if (count) {
306 stability->set_child_process_crash_count(count);
307 pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0);
308 }
309
310 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds(); 304 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds();
311 if (incremental_uptime_sec) 305 if (incremental_uptime_sec)
312 stability->set_incremental_uptime_sec(incremental_uptime_sec); 306 stability->set_incremental_uptime_sec(incremental_uptime_sec);
313 const uint64 uptime_sec = uptime.InSeconds(); 307 const uint64 uptime_sec = uptime.InSeconds();
314 if (uptime_sec) 308 if (uptime_sec)
315 stability->set_uptime_sec(uptime_sec); 309 stability->set_uptime_sec(uptime_sec);
316 } 310 }
317 311
318 void MetricsLog::RecordEnvironment( 312 void MetricsLog::RecordEnvironment(
319 const std::vector<metrics::MetricsProvider*>& metrics_providers, 313 const std::vector<metrics::MetricsProvider*>& metrics_providers,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 profile = uma_proto()->add_profiler_event(); 423 profile = uma_proto()->add_profiler_event();
430 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); 424 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE);
431 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); 425 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME);
432 } else { 426 } else {
433 // For the remaining calls, re-use the existing field. 427 // For the remaining calls, re-use the existing field.
434 profile = uma_proto()->mutable_profiler_event(0); 428 profile = uma_proto()->mutable_profiler_event(0);
435 } 429 }
436 430
437 WriteProfilerData(process_data, process_type, profile); 431 WriteProfilerData(process_data, process_type, profile);
438 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698