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

Side by Side Diff: tools/telemetry/telemetry/web_perf/metrics/responsiveness_metric.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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 import logging 4 import logging
5 5
6 from telemetry.value import improvement_direction
6 from telemetry.value import scalar 7 from telemetry.value import scalar
7 from telemetry.web_perf import timeline_interaction_record as tir_module 8 from telemetry.web_perf import timeline_interaction_record as tir_module
8 from telemetry.web_perf.metrics import mainthread_jank_stats 9 from telemetry.web_perf.metrics import mainthread_jank_stats
9 from telemetry.web_perf.metrics import timeline_based_metric 10 from telemetry.web_perf.metrics import timeline_based_metric
10 11
11 12
12 class ResponsivenessMetric(timeline_based_metric.TimelineBasedMetric): 13 class ResponsivenessMetric(timeline_based_metric.TimelineBasedMetric):
13 """Computes metrics that measure respsonsiveness on the record ranges. 14 """Computes metrics that measure respsonsiveness on the record ranges.
14 15
15 total_big_jank_thread_time is the total thread duration of all top 16 total_big_jank_thread_time is the total thread duration of all top
(...skipping 21 matching lines...) Expand all
37 except tir_module.NoThreadTimeDataException as e: 38 except tir_module.NoThreadTimeDataException as e:
38 #TODO(nednguyen): Report the warning with page_results system. 39 #TODO(nednguyen): Report the warning with page_results system.
39 logging.warning( 40 logging.warning(
40 'Main thread jank metrics cannot be computed for records %s since ' 41 'Main thread jank metrics cannot be computed for records %s since '
41 'trace does not contain thread time data. %s', 42 'trace does not contain thread time data. %s',
42 repr(interaction_records), repr(e)) 43 repr(interaction_records), repr(e))
43 return 44 return
44 45
45 results.AddValue(scalar.ScalarValue( 46 results.AddValue(scalar.ScalarValue(
46 results.current_page, 'responsive-total_big_jank_thread_time', 'ms', 47 results.current_page, 'responsive-total_big_jank_thread_time', 'ms',
47 jank_stats.total_big_jank_thread_time)) 48 jank_stats.total_big_jank_thread_time,
49 improvement_direction=improvement_direction.DOWN))
48 results.AddValue(scalar.ScalarValue( 50 results.AddValue(scalar.ScalarValue(
49 results.current_page, 'responsive-biggest_jank_thread_time', 'ms', 51 results.current_page, 'responsive-biggest_jank_thread_time', 'ms',
50 jank_stats.biggest_jank_thread_time)) 52 jank_stats.biggest_jank_thread_time,
53 improvement_direction=improvement_direction.DOWN))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698