Chromium Code Reviews| 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 [] |