Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 class _Result(object): | |
| 6 def __init__(self, trace_name, units, value, chart_name, data_type): | |
| 7 self.trace_name = trace_name | |
| 8 self.units = units | |
| 9 self.value = value | |
| 10 self.chart_name = chart_name | |
| 11 self.data_type = data_type | |
| 12 | |
| 13 | |
| 14 class FakeResults(object): | |
| 15 def __init__(self): | |
| 16 self._results = {} | |
| 17 self._summary_results = {} | |
| 18 | |
| 19 | |
|
chrishenry
2014/05/13 03:22:38
Are the 2 blank lines intentional?
nednguyen
2014/05/14 17:32:27
Done.
| |
| 20 def Add(self, trace_name, units, value, chart_name=None, data_type='default'): | |
| 21 self._results[trace_name] = _Result(trace_name, units, value, chart_name, | |
| 22 data_type) | |
| 23 | |
| 24 def AddSummary(self, trace_name, units, value, chart_name=None, | |
| 25 data_type='default'): | |
| 26 self._summary_results[trace_name] = _Result(trace_name, units, value, | |
| 27 chart_name, data_type) | |
| 28 | |
| 29 def GetResult(self, trace_name): | |
| 30 return self._results.get(trace_name) | |
| 31 | |
| 32 def GetSummaryResult(self, trace_name): | |
| 33 return self._summary_results.get(trace_name) | |
| OLD | NEW |