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 module tracing; | 5 module tracing; |
6 | 6 |
7 // To participate in the tracing ecosystem, implement the TraceProvider | 7 // To participate in the tracing ecosystem, implement the TraceProvider |
8 // interface and connect to the tracing app. Then, when the provider's Start() | 8 // interface and connect to the tracing app. Then, when the provider's Start() |
9 // function is called collect tracing data and pass it back via the provided | 9 // function is called collect tracing data and pass it back via the provided |
10 // TraceRecorder interface up until Stop() is called. | 10 // TraceRecorder interface up until Stop() is called. |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Request tracing data from all connected providers to stream to | 24 // Request tracing data from all connected providers to stream to |
25 // |stream|. | 25 // |stream|. |
26 Start(handle<data_pipe_producer> stream, string categories); | 26 Start(handle<data_pipe_producer> stream, string categories); |
27 | 27 |
28 // Stop tracing and flush results to the |stream| passed in to Start(). | 28 // Stop tracing and flush results to the |stream| passed in to Start(). |
29 // Closes |stream| when all data is collected. | 29 // Closes |stream| when all data is collected. |
30 StopAndFlush(); | 30 StopAndFlush(); |
31 }; | 31 }; |
32 | 32 |
33 // These times are used to determine startup performance metrics. | 33 // These times are used to determine startup performance metrics. |
34 // TODO(msw): Use TimeTicks to avoid system clock changes: crbug.com/521164 | 34 // TODO(msw): Find a way to convert *_time metrics into TimeTicks earlier (ref: |
| 35 // https://goo.gl/vZ8dZW). |
35 struct StartupPerformanceTimes { | 36 struct StartupPerformanceTimes { |
36 // TODO(msw): Rename to match "BrowserMainEntryTimeAbsolute" metric? | 37 // TODO(msw): Rename to match "BrowserMainEntryTimeAbsolute" metric? |
37 int64 shell_process_creation_time; | 38 int64 shell_process_creation_time; |
38 int64 shell_main_entry_point_time; | 39 int64 shell_main_entry_point_time; |
39 int64 browser_message_loop_start_time; | 40 int64 browser_message_loop_start_ticks; |
40 int64 browser_window_display_time; | 41 int64 browser_window_display_ticks; |
41 int64 browser_open_tabs_time_delta; | 42 int64 browser_open_tabs_time_delta; |
42 // TODO(msw): Rename to avoid "web contents"? | 43 // TODO(msw): Rename to avoid "web contents"? |
43 int64 first_web_contents_main_frame_load_time; | 44 int64 first_web_contents_main_frame_load_ticks; |
44 // TODO(msw): Rename to match "FirstWebContents.NonEmptyPaint" metric? | 45 // TODO(msw): Rename to match "FirstWebContents.NonEmptyPaint" metric? |
45 int64 first_visually_non_empty_layout_time; | 46 int64 first_visually_non_empty_layout_ticks; |
46 }; | 47 }; |
47 | 48 |
48 // This interface accepts startup performance timing from a variety of sources. | 49 // This interface accepts startup performance timing from a variety of sources. |
49 interface StartupPerformanceDataCollector { | 50 interface StartupPerformanceDataCollector { |
50 // These setters may be called many times, only the first time is recorded. | 51 // These setters may be called many times, only the first time is recorded. |
51 SetShellProcessCreationTime(int64 time); | 52 SetShellProcessCreationTime(int64 time); |
52 SetShellMainEntryPointTime(int64 time); | 53 SetShellMainEntryPointTime(int64 time); |
53 SetBrowserMessageLoopStartTime(int64 time); | 54 SetBrowserMessageLoopStartTicks(int64 ticks); |
54 SetBrowserWindowDisplayTime(int64 time); | 55 SetBrowserWindowDisplayTicks(int64 ticks); |
55 SetBrowserOpenTabsTimeDelta(int64 delta); | 56 SetBrowserOpenTabsTimeDelta(int64 delta); |
56 SetFirstWebContentsMainFrameLoadTime(int64 time); | 57 SetFirstWebContentsMainFrameLoadTicks(int64 ticks); |
57 SetFirstVisuallyNonEmptyLayoutTime(int64 time); | 58 SetFirstVisuallyNonEmptyLayoutTicks(int64 ticks); |
58 | 59 |
59 // Get the currently available startup performance times. | 60 // Get the currently available startup performance times. |
60 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); | 61 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); |
61 }; | 62 }; |
OLD | NEW |