Chromium Code Reviews| 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 TraceController | 7 // To participate in the tracing ecosystem, implement the TraceController |
| 8 // interface and connect to the tracing app. Then, when the controller's Start() | 8 // interface and connect to the tracing app. Then, when the controller'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 // TraceDataCollector interface up until Stop() is called. | 10 // TraceDataCollector interface up until Stop() is called. |
| 11 | 11 |
| 12 interface TraceController { | 12 interface TraceController { |
| 13 StartTracing(string categories, TraceDataCollector collector); | 13 StartTracing(string categories, TraceDataCollector collector); |
| 14 StopTracing(); | 14 StopTracing(); |
| 15 }; | 15 }; |
| 16 | 16 |
| 17 interface TraceDataCollector { | 17 interface TraceDataCollector { |
| 18 DataCollected(string json); | 18 DataCollected(string json); |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 interface TraceCoordinator { | 21 interface TraceCoordinator { |
| 22 // Request tracing data from all connected TraceControllers to stream to | 22 // Request tracing data from all connected TraceControllers to stream to |
| 23 // |stream|. | 23 // |stream|. |
| 24 Start(handle<data_pipe_producer> stream, string categories); | 24 Start(handle<data_pipe_producer> stream, string categories); |
| 25 | 25 |
| 26 // Stop tracing and flush results to file. | 26 // Stop tracing and flush results to file. |
| 27 StopAndFlush(); | 27 StopAndFlush(); |
| 28 }; | 28 }; |
| 29 | |
| 30 // These times are used to determine startup performance metrics. | |
| 31 struct StartupPerformanceTimes { | |
| 32 // TODO(msw): Rename to match "BrowserMainEntryTimeAbsolute" metric? | |
| 33 int64 shell_process_creation_time; | |
|
sky
2015/08/12 23:54:36
Again, I think all this should be timeticks, not t
msw
2015/08/14 23:20:35
I filed http://crbug.com/521164 for this and added
| |
| 34 int64 browser_message_loop_start_time; | |
| 35 int64 browser_window_display_time; | |
| 36 int64 browser_open_tabs_time; | |
| 37 // TODO(msw): Rename to avoid "web contents"? | |
| 38 int64 first_web_contents_main_frame_load_time; | |
| 39 // TODO(msw): Rename to match "FirstWebContents.NonEmptyPaint" metric? | |
| 40 int64 first_visually_non_empty_layout_time; | |
| 41 }; | |
| 42 | |
| 43 interface StartupPerformanceController { | |
|
yzshen1
2015/08/13 15:59:12
'Controller' seems a little confusing. Because Tra
msw
2015/08/14 23:20:35
I went with StartupPerformanceDataCollector, but i
yzshen1
2015/08/17 05:46:38
(Optional) One idea is "Performance" -> "Perf". So
| |
| 44 // These setters may be called many times, only the first call is recorded. | |
| 45 SetShellProcessCreationTime(int64 time); | |
| 46 SetBrowserMessageLoopStartTime(int64 time); | |
| 47 SetBrowserWindowDisplayTime(int64 time); | |
| 48 SetBrowserOpenTabsTime(int64 time); | |
| 49 SetFirstWebContentsMainFrameLoadTime(int64 time); | |
| 50 SetFirstVisuallyNonEmptyLayoutTime(int64 time); | |
| 51 | |
| 52 GetStartupPerformanceTimes() => (StartupPerformanceTimes times); | |
| 53 }; | |
| OLD | NEW |