Commit 36b96a42 authored by Stephen Chenney's avatar Stephen Chenney Committed by Commit Bot

Delay UMA submission until end of lifecycle

We were submitting UMA every time we recorded a update time measurement,
but some metric, particularly ForcedStyleAndLayout, may run multiple
times per frame. In such cases we want the per lifecycle time, to make
it comparable to UKM data and to avoid considering lots of small updates
to be less bad than one big update.

R=vmpstr@chromium.org
BUG=869966

Only report UMA once per lifecycle update

Change-Id: If4eebd782b4d109b18a608ece2a351226bb74732
Reviewed-on: https://chromium-review.googlesource.com/c/1277549
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599332}
parent 6f77e53c
...@@ -140,9 +140,6 @@ void LocalFrameUkmAggregator::RecordSample(size_t metric_index, ...@@ -140,9 +140,6 @@ void LocalFrameUkmAggregator::RecordSample(size_t metric_index,
record.total_duration += duration; record.total_duration += duration;
++record.sample_count; ++record.sample_count;
// Record the UMA
record.uma_counter->CountMicroseconds(duration);
// Just record the duration for ratios. We compute the ratio later // Just record the duration for ratios. We compute the ratio later
// when we know the frame time. // when we know the frame time.
ratio_metric_records_[metric_index].interval_duration += duration; ratio_metric_records_[metric_index].interval_duration += duration;
...@@ -167,14 +164,24 @@ void LocalFrameUkmAggregator::RecordPrimarySample(TimeTicks start, ...@@ -167,14 +164,24 @@ void LocalFrameUkmAggregator::RecordPrimarySample(TimeTicks start,
++primary_metric_.sample_count; ++primary_metric_.sample_count;
// Compute all the dependent metrics // Compute all the dependent metrics
for (auto& record : ratio_metric_records_) { for (int i = 0; i < kCount; ++i) {
double ratio = auto& absolute_record = absolute_metric_records_[i];
record.interval_duration.InMicrosecondsF() / duration.InMicrosecondsF(); auto& ratio_record = ratio_metric_records_[i];
if (ratio > record.worst_case_ratio)
record.worst_case_ratio = ratio; // Record the UMA for the absolute metrics. This enables aggregating UMA
record.total_ratio += ratio; // over the entire lifecycle, important for steps (forced style and layout)
++record.sample_count; // that might take place more than once per lifecycle update.
record.interval_duration = TimeDelta(); absolute_record.uma_counter->CountMicroseconds(
ratio_record.interval_duration);
// Aggregate the UKM ratio information
double ratio = ratio_record.interval_duration.InMicrosecondsF() /
duration.InMicrosecondsF();
if (ratio > ratio_record.worst_case_ratio)
ratio_record.worst_case_ratio = ratio;
ratio_record.total_ratio += ratio;
++ratio_record.sample_count;
ratio_record.interval_duration = TimeDelta();
} }
has_data_ = true; has_data_ = true;
......
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