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

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

Issue 985773002: Introducing phased profiling framework (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@write_to_file
Patch Set: isherman@ comments Created 5 years, 9 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 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 #include "chrome/browser/metrics/chrome_metrics_service_client.h" 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 372
373 void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() { 373 void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() {
374 // Start the next part of the init task: fetching performance data. This will 374 // Start the next part of the init task: fetching performance data. This will
375 // call into |FinishedReceivingProfilerData()| when the task completes. 375 // call into |FinishedReceivingProfilerData()| when the task completes.
376 metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously( 376 metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously(
377 weak_ptr_factory_.GetWeakPtr()); 377 weak_ptr_factory_.GetWeakPtr());
378 } 378 }
379 379
380 void ChromeMetricsServiceClient::ReceivedProfilerData( 380 void ChromeMetricsServiceClient::ReceivedProfilerData(
381 const tracked_objects::ProcessDataSnapshot& process_data, 381 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase,
382 int process_type) { 382 base::ProcessId process_id,
383 profiler_metrics_provider_->RecordProfilerData(process_data, process_type); 383 content::ProcessType process_type,
384 int profiling_phase,
385 const base::TimeDelta& phase_start,
386 const base::TimeDelta& phase_finish,
387 const metrics::ProfilerEvents& past_events) {
Alexei Svitkine (slow) 2015/03/16 22:00:15 I still think we should group all of these fields
vadimt 2015/03/16 23:09:13 I suggest moving this to the next CL. isherman@ qu
Alexei Svitkine (slow) 2015/03/17 14:53:41 Can you elaborate what you're suggesting? i.e. are
vadimt 2015/03/17 15:12:53 The latter. Added TODO.
388 profiler_metrics_provider_->RecordProfilerData(
389 process_data_phase, process_id, process_type, profiling_phase,
390 phase_start, phase_finish, past_events);
384 } 391 }
385 392
386 void ChromeMetricsServiceClient::FinishedReceivingProfilerData() { 393 void ChromeMetricsServiceClient::FinishedReceivingProfilerData() {
387 finished_gathering_initial_metrics_callback_.Run(); 394 finished_gathering_initial_metrics_callback_.Run();
388 } 395 }
389 396
390 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { 397 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
391 DCHECK(thread_checker_.CalledOnValidThread()); 398 DCHECK(thread_checker_.CalledOnValidThread());
392 399
393 // This function should only be called as the callback from an ansynchronous 400 // This function should only be called as the callback from an ansynchronous
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 // Capture the histogram samples. 560 // Capture the histogram samples.
554 if (dumps_with_crash != 0) 561 if (dumps_with_crash != 0)
555 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); 562 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash);
556 if (dumps_with_no_crash != 0) 563 if (dumps_with_no_crash != 0)
557 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); 564 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash);
558 int total_dumps = dumps_with_crash + dumps_with_no_crash; 565 int total_dumps = dumps_with_crash + dumps_with_no_crash;
559 if (total_dumps != 0) 566 if (total_dumps != 0)
560 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); 567 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps);
561 } 568 }
562 #endif // defined(OS_WIN) 569 #endif // defined(OS_WIN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698