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

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

Issue 809393002: Added support for improvement_direction to relevant values, which is propogated to chartjson. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linter issues Created 5 years, 11 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
Index: tools/perf/benchmarks/service_worker.py
diff --git a/tools/perf/benchmarks/service_worker.py b/tools/perf/benchmarks/service_worker.py
index 6fbdc10977ac3bcd3e5940734ba5d22c0d6c3337..d7fd19221cec6cb802eaa472d33161bb172d5089 100644
--- a/tools/perf/benchmarks/service_worker.py
+++ b/tools/perf/benchmarks/service_worker.py
@@ -13,6 +13,7 @@ from telemetry.core import util
from telemetry.page import page_test
from telemetry.timeline import async_slice as async_slice_module
from telemetry.timeline import slice as slice_module
+from telemetry.value import improvement_direction
from telemetry.value import scalar
@@ -29,10 +30,12 @@ class _ServiceWorkerTimelineMetric(object):
sanitized_counter_name = counter_name.replace('.', '_')
results.AddValue(scalar.ScalarValue(
- results.current_page, sanitized_counter_name, 'count', total))
+ results.current_page, sanitized_counter_name, 'count', total,
+ improvement_direction=improvement_direction.DOWN))
results.AddValue(scalar.ScalarValue(
results.current_page, sanitized_counter_name + '_avg', 'count',
- total / float(len(counter.totals))))
+ total / float(len(counter.totals)),
+ improvement_direction=improvement_direction.DOWN))
def AddResultsOfEvents(
self, process, thread_regex_string, event_regex_string, results):
@@ -75,11 +78,14 @@ class _ServiceWorkerTimelineMetric(object):
full_name = thread_name + '|' + sanitized_event_name
results.AddValue(scalar.ScalarValue(
- results.current_page, full_name, 'ms', total))
+ results.current_page, full_name, 'ms', total,
+ improvement_direction=improvement_direction.DOWN))
results.AddValue(scalar.ScalarValue(
- results.current_page, full_name + '_max', 'ms', biggest_jank))
+ results.current_page, full_name + '_max', 'ms', biggest_jank,
+ improvement_direction=improvement_direction.DOWN))
results.AddValue(scalar.ScalarValue(
- results.current_page, full_name + '_avg', 'ms', total / len(times)))
+ results.current_page, full_name + '_avg', 'ms', total / len(times),
+ improvement_direction=improvement_direction.DOWN))
class _ServiceWorkerMeasurement(page_test.PageTest):
@@ -160,7 +166,8 @@ class _ServiceWorkerMicroBenchmarkMeasurement(page_test.PageTest):
json = tab.EvaluateJavaScript('window.results || {}')
for key, value in json.iteritems():
results.AddValue(scalar.ScalarValue(
- results.current_page, key, value['units'], value['value']))
+ results.current_page, key, value['units'], value['value'],
+ improvement_direction=improvement_direction.DOWN))
# Retrieve TRACE_EVENTs
timeline_metric = _ServiceWorkerTimelineMetric()

Powered by Google App Engine
This is Rietveld 408576698