Unverified Commit e48e2e6a authored by Jim Graham's avatar Jim Graham Committed by GitHub

add rasterizer start times to timeline summaries (#58514)

parent 6c8d7b00
......@@ -19,6 +19,12 @@ const JsonEncoder _prettyEncoder = JsonEncoder.withIndent(' ');
/// phase. Anything past that is in the danger of missing the frame as 60FPS.
const Duration kBuildBudget = Duration(milliseconds: 16);
/// The name of the framework frame build events we need to filter or extract.
const String kBuildFrameEventName = 'Frame';
/// The name of the engine frame rasterization events we need to filter or extract.
const String kRasterizeFrameEventName = 'GPURasterizer::Draw';
/// Extracts statistics from a [Timeline].
class TimelineSummary {
/// Creates a timeline summary given a full timeline object.
......@@ -84,6 +90,9 @@ class TimelineSummary {
/// The total number of frames recorded in the timeline.
int countFrames() => _extractFrameDurations().length;
/// The total number of rasterizer cycles recorded in the timeline.
int countRasterizations() => _extractGpuRasterizerDrawDurations().length;
/// Encodes this summary as JSON.
Map<String, dynamic> get summaryJson {
final SceneDisplayLagSummarizer sceneDisplayLagSummarizer = _sceneDisplayLagSummarizer();
......@@ -100,18 +109,22 @@ class TimelineSummary {
'worst_frame_rasterizer_time_millis': computeWorstFrameRasterizerTimeMillis(),
'missed_frame_rasterizer_budget_count': computeMissedFrameRasterizerBudgetCount(),
'frame_count': countFrames(),
'frame_rasterizer_count': countRasterizations(),
'frame_build_times': _extractFrameDurations()
.map<int>((Duration duration) => duration.inMicroseconds)
.toList(),
'frame_rasterizer_times': _extractGpuRasterizerDrawDurations()
.map<int>((Duration duration) => duration.inMicroseconds)
.toList(),
'frame_begin_times': _extractBeginTimestamps('Frame')
'frame_begin_times': _extractBeginTimestamps(kBuildFrameEventName)
.map<int>((Duration duration) => duration.inMicroseconds)
.toList(),
'frame_rasterizer_begin_times': _extractBeginTimestamps(kRasterizeFrameEventName)
.map<int>((Duration duration) => duration.inMicroseconds)
.toList(),
'average_vsync_transitions_missed': sceneDisplayLagSummarizer.computeAverageVsyncTransitionsMissed(),
'90th_percentile_vsync_transitions_missed': sceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed(90.0),
'99th_percentile_vsync_transitions_missed': sceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed(99.0)
'99th_percentile_vsync_transitions_missed': sceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed(99.0),
};
}
......@@ -227,7 +240,7 @@ class TimelineSummary {
SceneDisplayLagSummarizer _sceneDisplayLagSummarizer() => SceneDisplayLagSummarizer(_extractNamedEvents(kSceneDisplayLagEvent));
List<Duration> _extractGpuRasterizerDrawDurations() => _extractBeginEndEvents('GPURasterizer::Draw');
List<Duration> _extractGpuRasterizerDrawDurations() => _extractBeginEndEvents(kRasterizeFrameEventName);
List<Duration> _extractFrameDurations() => _extractBeginEndEvents('Frame');
List<Duration> _extractFrameDurations() => _extractBeginEndEvents(kBuildFrameEventName);
}
......@@ -372,9 +372,11 @@ void main() {
'worst_frame_rasterizer_time_millis': 20.0,
'missed_frame_rasterizer_budget_count': 2,
'frame_count': 3,
'frame_rasterizer_count': 3,
'frame_build_times': <int>[17000, 9000, 19000],
'frame_rasterizer_times': <int>[18000, 10000, 20000],
'frame_begin_times': <int>[0, 18000, 28000],
'frame_rasterizer_begin_times': <int>[0, 18000, 28000],
'average_vsync_transitions_missed': 0.0,
'90th_percentile_vsync_transitions_missed': 0.0,
'99th_percentile_vsync_transitions_missed': 0.0
......@@ -431,9 +433,11 @@ void main() {
'worst_frame_rasterizer_time_millis': 20.0,
'missed_frame_rasterizer_budget_count': 2,
'frame_count': 3,
'frame_rasterizer_count': 3,
'frame_build_times': <int>[17000, 9000, 19000],
'frame_rasterizer_times': <int>[18000, 10000, 20000],
'frame_begin_times': <int>[0, 18000, 28000],
'frame_rasterizer_begin_times': <int>[0, 18000, 28000],
'average_vsync_transitions_missed': 8.0,
'90th_percentile_vsync_transitions_missed': 12.0,
'99th_percentile_vsync_transitions_missed': 12.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment