Telemetry: step 1 of removing redundant metrics

There are some code in renderingMetric for computing metrics that are
available as an UMA metric, too. Now that we can use UMA histograms in
Telemetry (crbug.com/927067), there is no need to have two
implementations for those metrics (one in the chromium repo and one in
the catapult repo), that can potentially get out of sync. So,

1. This CL adds
Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4 and
Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin4 to
benchmarks that use renderingMetric.

2. Next, we will change perf dashboard alert configurations to use the
above-mentioned UMA metrics instead of input_event_latency and
first_gesture_scroll_update_latency.

3. We will delete the catapult code for computing input_event_latency
and first_gesture_scroll_update_latency (crrev.com/c/1526202).

To see that the UMA versions and the Catapult versions have very
similar values you can check the rendering.{desktop, mobile}
benchmarks that have had both versions for a while now. E.g:

https://v2spa-dot-chromeperf.appspot.com/#session=95f926ce50a834326541dfee68bcc5b0ec04fbf12a1b9b77794ece90a63a20bb

BUG=943559

Change-Id: Ia47ac69e97748cc17eebb648336b2d54733f2ce8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526165
Reviewed-by: Annie Sullivan <sullivan@chromium.org>
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Ravi Mistry <rmistry@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Ehsan Chiniforooshan <chiniforooshan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641872}
diff --git a/tools/perf/benchmarks/smoothness.py b/tools/perf/benchmarks/smoothness.py
index 179382b..c4a6c3e 100644
--- a/tools/perf/benchmarks/smoothness.py
+++ b/tools/perf/benchmarks/smoothness.py
@@ -21,7 +21,10 @@
   def CreateCoreTimelineBasedMeasurementOptions(self):
     category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
     options = timeline_based_measurement.Options(category_filter)
-    options.SetTimelineBasedMetrics(['renderingMetric'])
+    options.config.chrome_trace_config.EnableUMAHistograms(
+        'Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin4',
+        'Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4')
+    options.SetTimelineBasedMetrics(['renderingMetric', 'umaMetric'])
     return options
 
 
diff --git a/tools/perf/contrib/cluster_telemetry/rendering_ct.py b/tools/perf/contrib/cluster_telemetry/rendering_ct.py
index 35c33ba..e0b2670 100644
--- a/tools/perf/contrib/cluster_telemetry/rendering_ct.py
+++ b/tools/perf/contrib/cluster_telemetry/rendering_ct.py
@@ -40,5 +40,8 @@
   def CreateCoreTimelineBasedMeasurementOptions(self):
     category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
     options = timeline_based_measurement.Options(category_filter)
-    options.SetTimelineBasedMetrics(['renderingMetric'])
+    options.config.chrome_trace_config.EnableUMAHistograms(
+        'Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin4',
+        'Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4')
+    options.SetTimelineBasedMetrics(['renderingMetric', 'umaMetric'])
     return options
diff --git a/tools/perf/contrib/cluster_telemetry/repaint.py b/tools/perf/contrib/cluster_telemetry/repaint.py
index ed88aa6..97f9133 100644
--- a/tools/perf/contrib/cluster_telemetry/repaint.py
+++ b/tools/perf/contrib/cluster_telemetry/repaint.py
@@ -44,5 +44,8 @@
   def CreateCoreTimelineBasedMeasurementOptions(self):
     category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
     options = timeline_based_measurement.Options(category_filter)
-    options.SetTimelineBasedMetrics(['renderingMetric'])
+    options.config.chrome_trace_config.EnableUMAHistograms(
+        'Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin4',
+        'Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4')
+    options.SetTimelineBasedMetrics(['renderingMetric', 'umaMetric'])
     return options
diff --git a/tools/perf/contrib/cros_benchmarks/ui_smoothness_bench.py b/tools/perf/contrib/cros_benchmarks/ui_smoothness_bench.py
index 8838cbc..707f20db 100644
--- a/tools/perf/contrib/cros_benchmarks/ui_smoothness_bench.py
+++ b/tools/perf/contrib/cros_benchmarks/ui_smoothness_bench.py
@@ -22,5 +22,8 @@
   def CreateCoreTimelineBasedMeasurementOptions(self):
     category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
     options = timeline_based_measurement.Options(category_filter)
-    options.SetTimelineBasedMetrics(['renderingMetric'])
+    options.config.chrome_trace_config.EnableUMAHistograms(
+        'Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin4',
+        'Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4')
+    options.SetTimelineBasedMetrics(['renderingMetric', 'umaMetric'])
     return options
diff --git a/tools/perf/contrib/vr_benchmarks/vr_benchmarks.py b/tools/perf/contrib/vr_benchmarks/vr_benchmarks.py
index ae56555..a68ba9c7 100644
--- a/tools/perf/contrib/vr_benchmarks/vr_benchmarks.py
+++ b/tools/perf/contrib/vr_benchmarks/vr_benchmarks.py
@@ -249,7 +249,10 @@
   def CreateCoreTimelineBasedMeasurementOptions(self):
     category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
     options = timeline_based_measurement.Options(category_filter)
-    options.SetTimelineBasedMetrics(['renderingMetric'])
+    options.config.chrome_trace_config.EnableUMAHistograms(
+        'Event.Latency.ScrollBegin.Touch.TimeToScrollUpdateSwapBegin4',
+        'Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin4')
+    options.SetTimelineBasedMetrics(['renderingMetric', 'umaMetric'])
     return options
 
   def CreateStorySet(self, options):