Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/browser/startup_metric_utils.h" | 5 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 return; | 711 return; |
| 712 is_first_call = false; | 712 is_first_call = false; |
| 713 if (!ShouldLogStartupHistogram()) | 713 if (!ShouldLogStartupHistogram()) |
| 714 return; | 714 return; |
| 715 | 715 |
| 716 UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT( | 716 UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT( |
| 717 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad2", | 717 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.MainFrameLoad2", |
| 718 g_process_creation_ticks.Get(), ticks); | 718 g_process_creation_ticks.Get(), ticks); |
| 719 } | 719 } |
| 720 | 720 |
| 721 void RecordFirstWebContentsNonEmptyPaint(base::TimeTicks ticks) { | 721 void RecordFirstWebContentsNonEmptyPaint( |
| 722 base::TimeTicks now, | |
| 723 base::TimeTicks render_process_host_init_time) { | |
| 722 static bool is_first_call = true; | 724 static bool is_first_call = true; |
| 723 if (!is_first_call || ticks.is_null()) | 725 if (!is_first_call || now.is_null()) |
| 724 return; | 726 return; |
| 725 is_first_call = false; | 727 is_first_call = false; |
| 726 | 728 |
| 727 // Log Startup.BrowserMainToRendererMain now that the first renderer main | 729 // Log Startup.BrowserMainToRendererMain now that the first renderer main |
| 728 // entry time and the startup temperature are known. | 730 // entry time and the startup temperature are known. |
| 729 RecordRendererMainEntryHistogram(); | 731 RecordRendererMainEntryHistogram(); |
| 730 | 732 |
| 731 if (!ShouldLogStartupHistogram()) | 733 if (!ShouldLogStartupHistogram()) |
| 732 return; | 734 return; |
| 733 | 735 |
| 734 base::StackSamplingProfiler::SetProcessMilestone( | 736 base::StackSamplingProfiler::SetProcessMilestone( |
| 735 metrics::CallStackProfileMetricsProvider::FIRST_NONEMPTY_PAINT); | 737 metrics::CallStackProfileMetricsProvider::FIRST_NONEMPTY_PAINT); |
| 736 UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT( | 738 UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE_AND_SAME_VERSION_COUNT( |
| 737 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint2", | 739 UMA_HISTOGRAM_LONG_TIMES_100, "Startup.FirstWebContents.NonEmptyPaint2", |
| 738 g_process_creation_ticks.Get(), ticks); | 740 g_process_creation_ticks.Get(), now); |
| 739 UMA_HISTOGRAM_WITH_TEMPERATURE( | 741 UMA_HISTOGRAM_WITH_TEMPERATURE( |
| 740 UMA_HISTOGRAM_LONG_TIMES_100, | 742 UMA_HISTOGRAM_LONG_TIMES_100, |
| 741 "Startup.BrowserMessageLoopStart.To.NonEmptyPaint2", | 743 "Startup.BrowserMessageLoopStart.To.NonEmptyPaint2", |
| 742 ticks - g_message_loop_start_ticks.Get()); | 744 now - g_message_loop_start_ticks.Get()); |
| 745 | |
| 746 UMA_HISTOGRAM_WITH_TEMPERATURE( | |
|
gab
2017/06/01 14:56:45
UMA_HISTOGRAM_AND_TRACE_WITH_TEMPERATURE
so it ap
| |
| 747 UMA_HISTOGRAM_LONG_TIMES_100, | |
| 748 "Startup.FirstWebContents.RenderProcessHostInit.ToNonEmptyPaint", | |
| 749 now - render_process_host_init_time); | |
| 743 } | 750 } |
| 744 | 751 |
| 745 void RecordFirstWebContentsMainNavigationStart(base::TimeTicks ticks, | 752 void RecordFirstWebContentsMainNavigationStart(base::TimeTicks ticks, |
| 746 WebContentsWorkload workload) { | 753 WebContentsWorkload workload) { |
| 747 static bool is_first_call = true; | 754 static bool is_first_call = true; |
| 748 if (!is_first_call || ticks.is_null()) | 755 if (!is_first_call || ticks.is_null()) |
| 749 return; | 756 return; |
| 750 is_first_call = false; | 757 is_first_call = false; |
| 751 if (!ShouldLogStartupHistogram()) | 758 if (!ShouldLogStartupHistogram()) |
| 752 return; | 759 return; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 UMA_HISTOGRAM_LONG_TIMES_100, | 827 UMA_HISTOGRAM_LONG_TIMES_100, |
| 821 "Startup.BrowserWindow.FirstPaint.CompositingEnded", | 828 "Startup.BrowserWindow.FirstPaint.CompositingEnded", |
| 822 g_process_creation_ticks.Get(), ticks); | 829 g_process_creation_ticks.Get(), ticks); |
| 823 } | 830 } |
| 824 | 831 |
| 825 base::TimeTicks MainEntryPointTicks() { | 832 base::TimeTicks MainEntryPointTicks() { |
| 826 return g_browser_main_entry_point_ticks.Get(); | 833 return g_browser_main_entry_point_ticks.Get(); |
| 827 } | 834 } |
| 828 | 835 |
| 829 } // namespace startup_metric_utils | 836 } // namespace startup_metric_utils |
| OLD | NEW |