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

Side by Side Diff: components/startup_metric_utils/startup_metric_utils.cc

Issue 1421293005: Move new Startup.FirstWebContents.* stats to Startup.FirstWebContents.*2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ab2_moar_betta_metrics
Patch Set: Created 5 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/startup_metric_utils/startup_metric_utils.h" 5 #include "components/startup_metric_utils/startup_metric_utils.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 void RecordFirstWebContentsMainFrameLoad(const base::Time& time) { 422 void RecordFirstWebContentsMainFrameLoad(const base::Time& time) {
423 static bool is_first_call = true; 423 static bool is_first_call = true;
424 if (!is_first_call || time.is_null()) 424 if (!is_first_call || time.is_null())
425 return; 425 return;
426 is_first_call = false; 426 is_first_call = false;
427 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) 427 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null())
428 return; 428 return;
429 429
430 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( 430 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE(
431 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad2",
432 g_process_creation_time.Get(), time);
433 }
434
435 void RecordDeprecatedFirstWebContentsMainFrameLoad(const base::Time& time) {
436 static bool is_first_call = true;
437 if (!is_first_call || time.is_null())
438 return;
439 is_first_call = false;
440 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null())
441 return;
442
443 UMA_HISTOGRAM_WITH_STARTUP_TEMPERATURE(
431 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad", 444 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad",
432 g_process_creation_time.Get(), time); 445 time - g_process_creation_time.Get());
433 } 446 }
434 447
435 void RecordFirstWebContentsNonEmptyPaint(const base::Time& time) { 448 void RecordFirstWebContentsNonEmptyPaint(const base::Time& time) {
436 static bool is_first_call = true; 449 static bool is_first_call = true;
437 if (!is_first_call || time.is_null()) 450 if (!is_first_call || time.is_null())
438 return; 451 return;
439 is_first_call = false; 452 is_first_call = false;
440 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) 453 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null())
441 return; 454 return;
442 455
443 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE( 456 UMA_HISTOGRAM_AND_TRACE_WITH_STARTUP_TEMPERATURE(
457 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint2",
458 g_process_creation_time.Get(), time);
459 }
460
461 void RecordDeprecatedFirstWebContentsNonEmptyPaint(const base::Time& time) {
462 static bool is_first_call = true;
463 if (!is_first_call || time.is_null())
464 return;
465 is_first_call = false;
466 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null())
467 return;
468
469 UMA_HISTOGRAM_WITH_STARTUP_TEMPERATURE(
444 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint", 470 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint",
445 g_process_creation_time.Get(), time); 471 time - g_process_creation_time.Get());
446 } 472 }
447 473
448 void RecordFirstWebContentsMainNavigationStart(const base::Time& time) { 474 void RecordFirstWebContentsMainNavigationStart(const base::Time& time) {
449 static bool is_first_call = true; 475 static bool is_first_call = true;
450 if (!is_first_call || time.is_null()) 476 if (!is_first_call || time.is_null())
451 return; 477 return;
452 is_first_call = false; 478 is_first_call = false;
453 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null()) 479 if (WasNonBrowserUIDisplayed() || g_process_creation_time.Get().is_null())
454 return; 480 return;
455 481
(...skipping 19 matching lines...) Expand all
475 501
476 base::Time MainEntryPointTime() { 502 base::Time MainEntryPointTime() {
477 return g_main_entry_point_time.Get(); 503 return g_main_entry_point_time.Get();
478 } 504 }
479 505
480 StartupTemperature GetStartupTemperature() { 506 StartupTemperature GetStartupTemperature() {
481 return g_startup_temperature; 507 return g_startup_temperature;
482 } 508 }
483 509
484 } // namespace startup_metric_utils 510 } // namespace startup_metric_utils
OLDNEW
« no previous file with comments | « components/startup_metric_utils/startup_metric_utils.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698