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

Unified Diff: tools/perf/benchmarks/rail.py

Issue 1371403004: CL for perf tryjob on mac Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | tools/run-perf-test.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/rail.py
diff --git a/tools/perf/benchmarks/rail.py b/tools/perf/benchmarks/rail.py
new file mode 100644
index 0000000000000000000000000000000000000000..d4da284e037a758a62ffb2365d0be17983b252e8
--- /dev/null
+++ b/tools/perf/benchmarks/rail.py
@@ -0,0 +1,52 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import os
+
+
+from core import perf_benchmark
+
+from telemetry.timeline import tracing_category_filter
+from telemetry.value import scalar
+from telemetry.value import failure
+from telemetry.web_perf import trace_mappers_based_measurement
+
+import page_sets
+
+class RailMapperHandler(trace_mappers_based_measurement.TraceMapperHandler):
+ _weather_report_map_func_dir = os.path.join(
+ os.path.dirname(__file__), '..', '..', '..', 'third_party',
+ 'catapult', 'perf_insights', 'perf_insights', 'mappers',
+ 'weather_report_map_function.html')
+ def __init__(self):
+ super(RailMapperHandler, self).__init__(
+ trace_mapper_path=self._weather_report_map_func_dir)
+
+ def AddResults(self, pi_results, page, results):
+ wr_value = pi_results.FindValueNamed('wr')
+ try:
+ rail_score = wr_value['irTree']['overallScore']
+ results.AddValue(
+ scalar.ScalarValue(
+ page=results.current_page, name='RailScore', units='percent',
+ value=rail_score, important=True, description='RAIL score.'))
+ except Exception:
+ results.AddValue(
+ failure.FromMessage(
+ page=page, message='Failed to compute RAIL score.'))
+
+
+class RailTop25Sites(perf_benchmark.PerfBenchmark):
+ """Measures GPU timeline metric for the top 25 sites."""
+ page_set = page_sets.Top25SmoothPageSet
+ test = trace_mappers_based_measurement.TraceMapperBasedMeasurement
+
+ def CreateTimelineBasedMeasurementOptions(self):
+ options = trace_mappers_based_measurement.Options(
+ tracing_category_filter.CreateDebugOverheadFilter())
+ options.AddTraceMapperHandlers(RailMapperHandler())
+ return options
+
+ @classmethod
+ def Name(cls):
+ return 'rail.top_25_smooth'
« no previous file with comments | « no previous file | tools/run-perf-test.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698