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

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

Issue 165673008: [telemetry] Implement first version of timeline based measurement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/metrics/timeline_based_metric_request.py
diff --git a/tools/perf/metrics/timeline_based_metric_request.py b/tools/perf/metrics/timeline_based_metric_request.py
new file mode 100644
index 0000000000000000000000000000000000000000..4fd3602b61c9ba1e9499d80245effd6c5b5dcb0c
--- /dev/null
+++ b/tools/perf/metrics/timeline_based_metric_request.py
@@ -0,0 +1,26 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import re
+
+
+def IsTimelineMetricRequest(event_name):
+ return event_name.startswith('MetricRequest.')
+
+
+def ParseTimelineMetricRequest(event_name):
+ m = re.match('MetricRequest\.(.+)\/(.+)', event_name)
+ assert m
+ return (m.group(1), m.group(2))
tonyg 2014/02/26 17:20:04 style nit: 2 lines between top level definitions
+
+class TimelineBasedMetricRequest(object):
+ def __init__(self, event):
+ x, y = ParseTimelineMetricRequest(event.name)
+ self.logical_name = x
+ self.metric_type = y
+ self.start = event.start
+ self.end = event.end
+
+ def GetResultNameFor(self, result_name):
+ return "%s/%s" % (self.logical_name, result_name)

Powered by Google App Engine
This is Rietveld 408576698