Index: tools/telemetry/telemetry/value/histogram.py |
diff --git a/tools/telemetry/telemetry/value/histogram.py b/tools/telemetry/telemetry/value/histogram.py |
index 64fadb0a833773175cee0e62f059748200f16bef..cfc8b4fb5e74604bb85a8fa5644ecb74e46b8a2b 100644 |
--- a/tools/telemetry/telemetry/value/histogram.py |
+++ b/tools/telemetry/telemetry/value/histogram.py |
@@ -3,9 +3,10 @@ |
# found in the LICENSE file. |
import json |
-from telemetry import value as value_module |
from telemetry import perf_tests_helper |
+from telemetry import value as value_module |
from telemetry.value import histogram_util |
+from telemetry.value import summarizable |
class HistogramValueBucket(object): |
def __init__(self, low, high, count=0): |
@@ -26,12 +27,12 @@ class HistogramValueBucket(object): |
'"high": %i' % self.high, |
'"count": %i' % self.count]) |
-class HistogramValue(value_module.Value): |
+class HistogramValue(summarizable.SummarizableValue): |
def __init__(self, page, name, units, |
raw_value=None, raw_value_json=None, important=True, |
- description=None): |
+ description=None, improvement_direction=None): |
super(HistogramValue, self).__init__(page, name, units, important, |
- description) |
+ description, improvement_direction) |
if raw_value_json: |
assert raw_value == None, \ |
'Don\'t specify both raw_value and raw_value_json' |
@@ -54,12 +55,13 @@ class HistogramValue(value_module.Value): |
else: |
page_name = None |
return ('HistogramValue(%s, %s, %s, raw_json_string="%s", ' |
- 'important=%s, description=%s') % ( |
+ 'important=%s, description=%s, improvement_direction=%s') % ( |
page_name, |
self.name, self.units, |
self.ToJSONString(), |
self.important, |
- self.description) |
+ self.description, |
+ self.improvement_direction) |
def GetBuildbotDataType(self, output_context): |
if self._IsImportantGivenOutputIntent(output_context): |
@@ -104,6 +106,7 @@ class HistogramValue(value_module.Value): |
def FromDict(value_dict, page_dict): |
kwargs = value_module.Value.GetConstructorKwArgs(value_dict, page_dict) |
kwargs['raw_value'] = value_dict |
+ kwargs['improvement_direction'] = value_dict['improvement_direction'] |
return HistogramValue(**kwargs) |
@@ -115,7 +118,7 @@ class HistogramValue(value_module.Value): |
v0.page, v0.name, v0.units, |
raw_value_json=histogram_util.AddHistograms( |
[v.ToJSONString() for v in values]), |
- important=v0.important) |
+ important=v0.important, improvement_direction=v0.improvement_direction) |
@classmethod |
def MergeLikeValuesFromDifferentPages(cls, values, |