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

Side by Side Diff: tools/telemetry/telemetry/web_perf/metrics/single_event.py

Issue 1313243003: [Telemetry] Introduce SummarizableValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 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 4
5 from telemetry.value import improvement_direction
5 from telemetry.value import list_of_scalar_values 6 from telemetry.value import list_of_scalar_values
6 from telemetry.web_perf.metrics import timeline_based_metric 7 from telemetry.web_perf.metrics import timeline_based_metric
7 8
8 9
9 class _SingleEventMetric(timeline_based_metric.TimelineBasedMetric): 10 class _SingleEventMetric(timeline_based_metric.TimelineBasedMetric):
10 """Reports directly durations of specific trace events that start during the 11 """Reports directly durations of specific trace events that start during the
11 user interaction. 12 user interaction.
12 """ 13 """
13 14
14 def __init__(self, trace_event_name, metric_name, metric_description=None): 15 def __init__(self, trace_event_name, metric_name, metric_description=None):
(...skipping 17 matching lines...) Expand all
32 events_found.append(event.thread_duration) 33 events_found.append(event.thread_duration)
33 else: 34 else:
34 events_found.append(event.duration) 35 events_found.append(event.duration)
35 if not events_found: 36 if not events_found:
36 return 37 return
37 results.AddValue(list_of_scalar_values.ListOfScalarValues( 38 results.AddValue(list_of_scalar_values.ListOfScalarValues(
38 page=results.current_page, 39 page=results.current_page,
39 name=self._metric_name, 40 name=self._metric_name,
40 units='ms', 41 units='ms',
41 values=events_found, 42 values=events_found,
42 description=self._metric_description)) 43 description=self._metric_description,
44 improvement_direction=improvement_direction.DOWN))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698