Commit 5c0844e5 authored by Aaron Krajeski's avatar Aaron Krajeski Committed by Chromium LUCI CQ

Record toblob with new UMA metric

Our toblob metrics were all ending up in the overflow bucket:
https://uma.googleplex.com/p/chrome/histograms?sid=bc11d3b58d816ec456478bd44834c192

Also, UmaHistogramMicrosecondsTimesUnderTenMilliseconds is deprecated:
crbug.com/983261

Unfortunately I need to change their names in order to use the new macro
without messing up old data.

Bug: 1165901
Change-Id: I163a093ab055a989aded448a4b5ee0f69ec3582e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625291Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Reviewed-by: default avatarAaron Krajeski <aaronhk@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844334}
parent 60e7aba7
...@@ -86,24 +86,23 @@ void RecordIdleTaskStatusHistogram( ...@@ -86,24 +86,23 @@ void RecordIdleTaskStatusHistogram(
void RecordInitiateEncodingTimeHistogram(ImageEncodingMimeType mime_type, void RecordInitiateEncodingTimeHistogram(ImageEncodingMimeType mime_type,
base::TimeDelta elapsed_time) { base::TimeDelta elapsed_time) {
// TODO(crbug.com/983261) Change this to use UmaHistogramMicrosecondsTimes.
if (mime_type == kMimeTypePng) { if (mime_type == kMimeTypePng) {
UmaHistogramMicrosecondsTimesUnderTenMilliseconds( UmaHistogramMicrosecondsTimes(
"Blink.Canvas.ToBlob.InitiateEncodingDelay.PNG", elapsed_time); "Blink.Canvas.ToBlob.InitialEncodingDelay.PNG", elapsed_time);
} else if (mime_type == kMimeTypeJpeg) { } else if (mime_type == kMimeTypeJpeg) {
UmaHistogramMicrosecondsTimesUnderTenMilliseconds( UmaHistogramMicrosecondsTimes(
"Blink.Canvas.ToBlob.InitiateEncodingDelay.JPEG", elapsed_time); "Blink.Canvas.ToBlob.InitialEncodingDelay.JPEG", elapsed_time);
} }
} }
void RecordCompleteEncodingTimeHistogram(ImageEncodingMimeType mime_type, void RecordCompleteEncodingTimeHistogram(ImageEncodingMimeType mime_type,
base::TimeDelta elapsed_time) { base::TimeDelta elapsed_time) {
if (mime_type == kMimeTypePng) { if (mime_type == kMimeTypePng) {
UmaHistogramMicrosecondsTimesUnderTenMilliseconds( UmaHistogramMicrosecondsTimes("Blink.Canvas.ToBlob.TotalEncodingDelay.PNG",
"Blink.Canvas.ToBlob.CompleteEncodingDelay.PNG", elapsed_time); elapsed_time);
} else if (mime_type == kMimeTypeJpeg) { } else if (mime_type == kMimeTypeJpeg) {
UmaHistogramMicrosecondsTimesUnderTenMilliseconds( UmaHistogramMicrosecondsTimes("Blink.Canvas.ToBlob.TotalEncodingDelay.JPEG",
"Blink.Canvas.ToBlob.CompleteEncodingDelay.JPEG", elapsed_time); elapsed_time);
} }
} }
......
...@@ -288,6 +288,10 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -288,6 +288,10 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram base="true" name="Blink.Canvas.ToBlob.CompleteEncodingDelay" <histogram base="true" name="Blink.Canvas.ToBlob.CompleteEncodingDelay"
units="microseconds" expires_after="2021-01-31"> units="microseconds" expires_after="2021-01-31">
<obsolete>
Removed in M89. Obsolete and unused. This has been replaced with
Blink.Canvas.ToBlob.TotalEncodingDelay
</obsolete>
<owner>fserb@chromium.org</owner> <owner>fserb@chromium.org</owner>
<owner>aaronhk@chromium.org</owner> <owner>aaronhk@chromium.org</owner>
<summary> <summary>
...@@ -328,8 +332,44 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -328,8 +332,44 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Blink.Canvas.ToBlob.InitialEncodingDelay.{Type}"
units="microseconds" expires_after="2022-04-04">
<owner>aaronhk@chromium.org</owner>
<owner>fserb@chromium.org</owner>
<summary>
A new version of &quot;Blink.Canvas.ToBlob.InitiateEncodingDelay&quot;
(which will be allowed to expire) which allows for times &gt;10ms.
This metric measures the time spent from initiating image encoding (jpeg or
png) on idle task to the actual execution time of initiation, as part of a
canvas.toBlob API call.
This metric is useful in helping us adjust the IdleTaskStartTimeoutDelay in
canvas.toBlob. When the initialization idle task is delayed for longer than
IdleTaskStartTimeoutDelay, the browser will switch to a non-idle task to
force initialization and encoding to occur on the main thread.
In addition, metric values from OffscreenCanvas.convertToBlob API call are
also gathered into this histogram, because the logic flow is exactly the
same as canvas.toBlob. It's worth to note that the values can come from idle
tasks on either main or worker thread.
Note: This metric drops reports on clients with low-resolution clocks, which
means these reports will be biased against a portion of the population on
Windows. See Windows.HasHighResolutionTimeTicks for the affected sample.
</summary>
<token key="Type">
<variant name="JPEG"/>
<variant name="PNG"/>
</token>
</histogram>
<histogram base="true" name="Blink.Canvas.ToBlob.InitiateEncodingDelay" <histogram base="true" name="Blink.Canvas.ToBlob.InitiateEncodingDelay"
units="microseconds" expires_after="2021-01-31"> units="microseconds" expires_after="2021-01-31">
<obsolete>
Removed in M89. Obsolete and unused. This has been replaced with
Blink.Canvas.ToBlob.InitialEncodingDelay
</obsolete>
<owner>fserb@chromium.org</owner> <owner>fserb@chromium.org</owner>
<owner>aaronhk@chromium.org</owner> <owner>aaronhk@chromium.org</owner>
<summary> <summary>
...@@ -372,6 +412,41 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -372,6 +412,41 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Blink.Canvas.ToBlob.TotalEncodingDelay.{Type}"
units="microseconds" expires_after="2022-04-04">
<owner>aaronhk@chromium.org</owner>
<owner>fserb@chromium.org</owner>
<summary>
A new version of &quot;Blink.Canvas.ToBlob.InitiateEncodingDelay&quot;
(which will be allowed to expire) which allows for times &gt;10ms.
This metric measures the total time spent on completing encoding all the
rows of an image (jpeg or png), as part of a canvas.toBlob API call.
Encoding occurs during one or more idle periods on the main thread and the
waiting time of the next idle period is included in the measurement. If the
code has swtiched to force encoding path, we will not measure the delay in
this metric.
This metric is useful in helping us adjust the IdleTaskCompleteTimeoutDelay
in canvas.toBlob. When the encoding idle task is delayed for longer than
IdleTaskCompleteTimeoutDelay, the browser will switch to a non-idle task to
force encoding to happen on the main thread.
In addition, metric values from OffscreenCanvas.convertToBlob API call are
also gathered into this histogram, because the logic flow is exactly the
same as canvas.toBlob. It's worth to note that the values can come from idle
tasks on either main or worker thread.
Note: This metric drops reports on clients with low-resolution clocks, which
means these reports will be biased against a portion of the population on
Windows. See Windows.HasHighResolutionTimeTicks for the affected sample.
</summary>
<token key="Type">
<variant name="JPEG"/>
<variant name="PNG"/>
</token>
</histogram>
<histogram base="true" name="Blink.Canvas.ToDataURLScaledDuration" <histogram base="true" name="Blink.Canvas.ToDataURLScaledDuration"
units="microseconds/sqrt(pixels)" expires_after="2022-04-04"> units="microseconds/sqrt(pixels)" expires_after="2022-04-04">
<owner>fserb@chromium.org</owner> <owner>fserb@chromium.org</owner>
......
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