Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #! /usr/bin/env python | |
| 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """Log parsing for telemetry tests.""" | |
| 7 | |
| 8 import json | |
| 9 import logging | |
| 10 | |
| 11 | |
| 12 class TelemetryLogParser(object): | |
| 13 | |
| 14 def __init__(self): | |
| 15 self._chart = None | |
| 16 self._ref_chart = None | |
| 17 | |
| 18 def IsChartJson(self): | |
| 19 """This is the new telemetry --chartjson output format.""" | |
| 20 return True | |
| 21 | |
| 22 def Chart(self): | |
| 23 return self._chart | |
| 24 | |
| 25 def RefChart(self): | |
| 26 return self._ref_chart | |
| 27 | |
| 28 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
| |
| 29 try: | |
| 30 results = json.loads(line.strip()) | |
| 31 except ValueError: | |
| 32 return | |
| 33 if results.has_key('charts'): | |
| 34 if not self._chart: | |
| 35 self._chart = results | |
| 36 elif not self._ref_chart: | |
| 37 self._ref_chart = results | |
| 38 else: | |
| 39 logging.error('Too many result lines, dropping.') | |
| 40 | |
| 41 def FailedTests(self): | |
| 42 # TODO(sullivan): Does this need to be implemented? Not in process_log_utils | |
| 43 return [] | |
| OLD | NEW |