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

Unified Diff: tools/perf/metrics/timeline.py

Issue 140653003: Sanitize event names before adding to results object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | tools/perf/metrics/timeline_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/timeline.py
diff --git a/tools/perf/metrics/timeline.py b/tools/perf/metrics/timeline.py
index 75efd73d33ec562c19242a377e0e2d0a69f354f5..7434f5f97efbd70023f79f7baf97c857f2e03f3f 100644
--- a/tools/perf/metrics/timeline.py
+++ b/tools/perf/metrics/timeline.py
@@ -54,6 +54,10 @@ class TimelineMetric(Metric):
def renderer_process(self):
return self._renderer_process
+ @renderer_process.setter
+ def renderer_process(self, p):
+ self._renderer_process = p
+
def AddResults(self, tab, results):
return
@@ -89,7 +93,11 @@ class LoadTimesTimelineMetric(TimelineMetric):
times = [event.self_time for event in event_group]
total = sum(times)
biggest_jank = max(times)
- full_name = thread_name + '|' + event_name
+
+ # Results objects cannot contain the '.' character, so remove that here.
+ sanitized_event_name = event_name.replace('.', '_')
+
+ full_name = thread_name + '|' + sanitized_event_name
results.Add(full_name, 'ms', total)
results.Add(full_name + '_max', 'ms', biggest_jank)
results.Add(full_name + '_avg', 'ms', total / len(times))
« no previous file with comments | « no previous file | tools/perf/metrics/timeline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698