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

Unified Diff: scripts/slave/telemetry_utils.py

Issue 545803002: Update buildbots to parse new telemetry JSON format. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« scripts/slave/runtest.py ('K') | « scripts/slave/telemetry.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/telemetry_utils.py
diff --git a/scripts/slave/telemetry_utils.py b/scripts/slave/telemetry_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..d683fef33404329843c8ecabeb0dfd27782ac4fc
--- /dev/null
+++ b/scripts/slave/telemetry_utils.py
@@ -0,0 +1,43 @@
+#! /usr/bin/env python
+# Copyright (c) 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.
+
+"""Log parsing for telemetry tests."""
+
+import json
+import logging
+
+
+class TelemetryLogParser(object):
+
+ def __init__(self):
+ self._chart = None
+ self._ref_chart = None
+
+ def IsChartJson(self):
+ """This is the new telemetry --chartjson output format."""
+ return True
+
+ def Chart(self):
+ return self._chart
+
+ def RefChart(self):
+ return self._ref_chart
+
+ def ProcessLine(self, line):
sullivan 2014/09/05 04:30:00 Here is sample output from running the test: https
ghost stip (do not use) 2014/09/05 21:39:06 I was under the impression that telemetry would dr
sullivan 2014/09/05 21:47:03 Oops, I think I gave eakuefner some out-of-date ad
+ try:
+ results = json.loads(line.strip())
+ except ValueError:
+ return
+ if results.has_key('charts'):
+ if not self._chart:
+ self._chart = results
+ elif not self._ref_chart:
+ self._ref_chart = results
+ else:
+ logging.error('Too many result lines, dropping.')
+
+ def FailedTests(self):
+ # TODO(sullivan): Does this need to be implemented? Not in process_log_utils
+ return []
« scripts/slave/runtest.py ('K') | « scripts/slave/telemetry.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698