Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: tools/perf/measurements/smoothness.py

Issue 17757002: Add UMA/Telemetry stats for touch event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address some of sadrul's comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/view_messages.h ('k') | ui/base/latency_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/smoothness.py
diff --git a/tools/perf/measurements/smoothness.py b/tools/perf/measurements/smoothness.py
index 7ca8d69a96fe7459b2156d3cf25c4480f4479f7a..80b7cd6307ccfaf12f1718c0f9c98d3d20be6ef2 100644
--- a/tools/perf/measurements/smoothness.py
+++ b/tools/perf/measurements/smoothness.py
@@ -142,18 +142,23 @@ def CalcAnalysisResults(rendering_stats_deltas, results):
averageAnalysisTimeMS,
data_type='unimportant')
-def CalcLatencyResults(rendering_stats_deltas, results):
- inputEventCount = rendering_stats_deltas.get(
- 'inputEventCount', 0)
- totalInputLatencyInSeconds = rendering_stats_deltas.get(
- 'totalInputLatency', 0)
-
+def CalcLatency(rendering_stats_deltas, count_name, total_latency_name,
+ result_name, results):
+ eventCount = rendering_stats_deltas.get(count_name, 0)
+ totalLatencyInSeconds = rendering_stats_deltas.get(total_latency_name, 0)
averageLatency = DivideIfPossibleOrZero(
- (totalInputLatencyInSeconds * 1000), inputEventCount)
-
- results.Add('average_latency', 'ms', averageLatency,
- data_type='unimportant')
+ (totalLatencyInSeconds * 1000), eventCount)
+ results.Add(result_name, 'ms', averageLatency, data_type='unimportant')
+def CalcLatencyResults(rendering_stats_deltas, results):
+ CalcLatency(rendering_stats_deltas, 'inputEventCount', 'totalInputLatency',
+ 'average_latency', results)
+ CalcLatency(rendering_stats_deltas, 'touchUICount', 'totalTouchUILatency',
+ 'average_touch_ui_latency', results)
+ CalcLatency(rendering_stats_deltas, 'touchAckedCount',
+ 'totalTouchAckedLatency',
+ 'average_touch_acked_latency',
+ results)
class Smoothness(page_measurement.PageMeasurement):
def __init__(self):
« no previous file with comments | « content/common/view_messages.h ('k') | ui/base/latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698