Index: tools/perf/metrics/timeline.py |
diff --git a/tools/perf/metrics/timeline.py b/tools/perf/metrics/timeline.py |
index 54ac3951b2b899844c56c4852eca1e0454d7fcb3..f5137324f7cc8d7b4ad27639d548d800dfcc409d 100644 |
--- a/tools/perf/metrics/timeline.py |
+++ b/tools/perf/metrics/timeline.py |
@@ -5,6 +5,7 @@ import collections |
from telemetry.util.statistics import DivideIfPossibleOrZero |
from telemetry.web_perf.metrics import timeline_based_metric |
+from telemetry.value import improvement_direction |
from telemetry.value import scalar |
@@ -47,11 +48,14 @@ class LoadTimesTimelineMetric(timeline_based_metric.TimelineBasedMetric): |
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)) |
for counter_name, counter in renderer_process.counters.iteritems(): |
total = sum(counter.totals) |
@@ -60,10 +64,12 @@ class LoadTimesTimelineMetric(timeline_based_metric.TimelineBasedMetric): |
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)) |
# We want to generate a consistant picture of our thread usage, despite |
# having several process configurations (in-proc-gpu/single-proc). |
@@ -195,10 +201,11 @@ class ResultsForThread(object): |
tasks_per_frame = Rate(len(self.toplevel_slices), num_frames) |
results.AddValue(scalar.ScalarValue( |
results.current_page, ThreadCpuTimeResultName(self.name), |
- 'ms', cpu_per_frame)) |
+ 'ms', cpu_per_frame, improvement_direction=improvement_direction.DOWN)) |
results.AddValue(scalar.ScalarValue( |
results.current_page, ThreadTasksResultName(self.name), |
- 'tasks', tasks_per_frame)) |
+ 'tasks', tasks_per_frame, |
+ improvement_direction=improvement_direction.DOWN)) |
# Report mean frame time if this is the thread we are using for normalizing |
# other results. We could report other frame rates (eg. renderer_main) but |
# this might get confusing. |
@@ -207,7 +214,8 @@ class ResultsForThread(object): |
mean_frame_time = Rate(self.all_action_time, num_frames) |
results.AddValue(scalar.ScalarValue( |
results.current_page, ThreadMeanFrameTimeResultName(self.name), |
- 'ms', mean_frame_time)) |
+ 'ms', mean_frame_time, |
+ improvement_direction=improvement_direction.DOWN)) |
def AddDetailedResults(self, num_frames, results): |
slices_by_category = collections.defaultdict(list) |
@@ -220,13 +228,15 @@ class ResultsForThread(object): |
self_time_result = (float(self_time) / num_frames) if num_frames else 0 |
results.AddValue(scalar.ScalarValue( |
results.current_page, ThreadDetailResultName(self.name, category), |
- 'ms', self_time_result)) |
+ 'ms', self_time_result, |
+ improvement_direction=improvement_direction.DOWN)) |
all_measured_time = sum(all_self_times) |
idle_time = max(0, self.all_action_time - all_measured_time) |
idle_time_result = (float(idle_time) / num_frames) if num_frames else 0 |
results.AddValue(scalar.ScalarValue( |
results.current_page, ThreadDetailResultName(self.name, "idle"), |
- 'ms', idle_time_result)) |
+ 'ms', idle_time_result, |
+ improvement_direction=improvement_direction.DOWN)) |
def CountTracesWithName(self, substring): |
count = 0 |