Commit 891c835d authored by Ella Ge's avatar Ella Ge Committed by Commit Bot

Add scroll prediction over/under predict metric

This CL adds two metrics for scroll event prediction to help analyse
prediction behavior, Scroll.OverPredict and Scroll.UnderPredict.

The new metrics only records the y direction difference of prediction
result instead of euclidean distance, since y direction scroll is more
popular and only record one direction is easier for determine over/under
predict.


Bug: 836352
Change-Id: I2f83fa5404b02c52f8856dfb64fa0151b7b686d6
Reviewed-on: https://chromium-review.googlesource.com/c/1354314Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarNavid Zolghadr <nzolghadr@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612401}
parent c4db771a
......@@ -27164,6 +27164,41 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Event.InputEventPrediction.Accuracy.Scroll.OverPredict"
units="pixels" expires_after="M80">
<!-- Name completed by histogram_suffixes
name="InputEventPredictionAccuracy" -->
<owner>eirage@chromium.org</owner>
<summary>
Records y direction distance from a ScrollUpdate event's absolute scroll
position (count by accumulated delta) to the predicted scrolling position at
the event time when prediction is available and also the predicted result is
'OverPredict'. Over predict means the absolute value of predicted scroll
delta is larger than the real delta in the same time period.
Team: input-dev@chromium.org.
</summary>
</histogram>
<histogram name="Event.InputEventPrediction.Accuracy.Scroll.UnderPredict"
units="pixels" expires_after="M80">
<!-- Name completed by histogram_suffixes
name="InputEventPredictionAccuracy" -->
<owner>eirage@chromium.org</owner>
<summary>
Records y direction distance from a ScrollUpdate event's absolute scroll
position (count by accumulated delta) to the predicted scrolling position at
the event time when prediction is available and also the predicted result is
'UnderPredict'. Under predict means the absolute value of predicted scroll
delta is smaller than the real delta in the same time period.
GestureScrollUpdate events.
Team: input-dev@chromium.org.
</summary>
</histogram>
<histogram name="Event.InputEventPrediction.Accuracy.Touch" units="pixels">
<!-- Name completed by histogram_suffixes
name="InputEventPredictionAccuracy" -->
......@@ -131052,6 +131087,10 @@ uploading your change for review.
<suffix name="Short" label="predicted time less than 10ms."/>
<affected-histogram name="Event.InputEventPrediction.Accuracy.Mouse"/>
<affected-histogram name="Event.InputEventPrediction.Accuracy.Scroll"/>
<affected-histogram
name="Event.InputEventPrediction.Accuracy.Scroll.OverPredict"/>
<affected-histogram
name="Event.InputEventPrediction.Accuracy.Scroll.UnderPredict"/>
<affected-histogram name="Event.InputEventPrediction.Accuracy.Touch"/>
</histogram_suffixes>
......@@ -175,6 +175,20 @@ void ScrollPredictor::ComputeAccuracy(const WebScopedInputEvent& event) {
base::UmaHistogramCounts1000(
"Event.InputEventPrediction.Accuracy.Scroll." + suffix,
static_cast<int>(distance));
// If the distance from predicted position to actual position is in same
// direction as the delta_y, the result is under predicted, otherwise over
// predict.
float dist_y = temporary_accumulated_delta_.y() - predict_result.pos.y();
if (gesture_event.data.scroll_update.delta_y * dist_y < 0) {
base::UmaHistogramCounts1000(
"Event.InputEventPrediction.Accuracy.Scroll.OverPredict." + suffix,
static_cast<int>(std::abs(dist_y)));
} else {
base::UmaHistogramCounts1000(
"Event.InputEventPrediction.Accuracy.Scroll.UnderPredict." + suffix,
static_cast<int>(std::abs(dist_y)));
}
}
}
......
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