summaryJson property Null safety

Map<String, dynamic> summaryJson

Encodes this summary as JSON.

Data ends with "_time_millis" means time in milliseconds and numbers in the "frame_build_times", "frame_rasterizer_times", "frame_begin_times" and "frame_rasterizer_begin_times" lists are in microseconds.

  • "average_frame_build_time_millis": Average amount of time spent per frame in the framework building widgets, updating layout, painting and compositing. See computeAverageFrameBuildTimeMillis.
  • "90th_percentile_frame_build_time_millis" and "99th_percentile_frame_build_time_millis": The p-th percentile frame rasterization time in milliseconds. 90 and 99-th percentile number is usually a better metric to estimate worse cases. See discussion in https://github.com/flutter/flutter/pull/19121#issuecomment-419520765 See computePercentileFrameBuildTimeMillis.
  • "worst_frame_build_time_millis": The longest frame build time. See computeWorstFrameBuildTimeMillis.
  • "missed_frame_build_budget_count': The number of frames that missed the kBuildBudget and therefore are in the danger of missing frames. See computeMissedFrameBuildBudgetCount.
  • "average_frame_rasterizer_time_millis": Average amount of time spent per frame in the engine rasterizer. See computeAverageFrameRasterizerTimeMillis.
  • "90th_percentile_frame_rasterizer_time_millis" and "99th_percentile_frame_rasterizer_time_millis": The 90/99-th percentile frame rasterization time in milliseconds. See computePercentileFrameRasterizerTimeMillis.
  • "worst_frame_rasterizer_time_millis": The longest frame rasterization time. See computeWorstFrameRasterizerTimeMillis.
  • "missed_frame_rasterizer_budget_count": The number of frames that missed the kBuildBudget on the raster thread and therefore are in the danger of missing frames. See computeMissedFrameRasterizerBudgetCount.
  • "frame_count": The total number of frames recorded in the timeline. This is also the length of the "frame_build_times" and the "frame_begin_times" lists. See countFrames.
  • "frame_rasterizer_count": The total number of rasterizer cycles recorded in the timeline. This is also the length of the "frame_rasterizer_times" and the "frame_rasterizer_begin_times" lists. See countRasterizations.
  • "frame_build_times": The build time of each frame, by tracking the TimelineEvent with name kBuildFrameEventName.
  • "frame_rasterizer_times": The rasterize time of each frame, by tracking the TimelineEvent with name kRasterizeFrameEventName
  • "frame_begin_times": The build begin timestamp of each frame.
  • "frame_rasterizer_begin_times": The rasterize begin time of each frame.
  • "average_vsync_transitions_missed": Computes the average of the vsync_transitions_missed over the lag events. See SceneDisplayLagSummarizer.computeAverageVsyncTransitionsMissed.
  • "90th_percentile_vsync_transitions_missed" and "99th_percentile_vsync_transitions_missed": The 90/99-th percentile vsync_transitions_missed over the lag events. See SceneDisplayLagSummarizer.computePercentileVsyncTransitionsMissed.
  • "average_vsync_frame_lag": Computes the average of the time between platform vsync signal and the engine frame process start time. See VsyncFrameLagSummarizer.computeAverageVsyncFrameLag.
  • "90th_percentile_vsync_frame_lag" and "99th_percentile_vsync_frame_lag": The 90/99-th percentile delay between platform vsync signal and engine frame process start time. See VsyncFrameLagSummarizer.computePercentileVsyncFrameLag.

Implementation

Map<String, dynamic> get summaryJson {
  final SceneDisplayLagSummarizer sceneDisplayLagSummarizer = _sceneDisplayLagSummarizer();
  final VsyncFrameLagSummarizer vsyncFrameLagSummarizer = _vsyncFrameLagSummarizer();
  final Map<String, dynamic> profilingSummary = _profilingSummarizer().summarize();

  final Map<String, dynamic> timelineSummary = <String, dynamic>{
    'average_frame_build_time_millis': computeAverageFrameBuildTimeMillis(),
    '90th_percentile_frame_build_time_millis': computePercentileFrameBuildTimeMillis(90.0),
    '99th_percentile_frame_build_time_millis': computePercentileFrameBuildTimeMillis(99.0),
    'worst_frame_build_time_millis': computeWorstFrameBuildTimeMillis(),
    'missed_frame_build_budget_count': computeMissedFrameBuildBudgetCount(),
    'average_frame_rasterizer_time_millis': computeAverageFrameRasterizerTimeMillis(),
    '90th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(90.0),
    '99th_percentile_frame_rasterizer_time_millis': computePercentileFrameRasterizerTimeMillis(99.0),
    'worst_frame_rasterizer_time_millis': computeWorstFrameRasterizerTimeMillis(),
    'missed_frame_rasterizer_budget_count': computeMissedFrameRasterizerBudgetCount(),
    'frame_count': countFrames(),
    'frame_rasterizer_count': countRasterizations(),
    'new_gen_gc_count': newGenerationGarbageCollections(),
    'old_gen_gc_count': oldGenerationGarbageCollections(),
    '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(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),
    'average_vsync_frame_lag': vsyncFrameLagSummarizer.computeAverageVsyncFrameLag(),
    '90th_percentile_vsync_frame_lag': vsyncFrameLagSummarizer.computePercentileVsyncFrameLag(90.0),
    '99th_percentile_vsync_frame_lag': vsyncFrameLagSummarizer.computePercentileVsyncFrameLag(99.0),
  };

  timelineSummary.addAll(profilingSummary);
  return timelineSummary;
}