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

Unified Diff: tools/telemetry/telemetry/value/string.py

Issue 399893003: Add "description" attribute to Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix calls to Value constructor so that the tests pass. Created 6 years, 5 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
« no previous file with comments | « tools/telemetry/telemetry/value/skip.py ('k') | tools/telemetry/telemetry/value/value_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/value/string.py
diff --git a/tools/telemetry/telemetry/value/string.py b/tools/telemetry/telemetry/value/string.py
index 9ca47f5a969e8dc533e989dc446a7b24cf0c4c42..a62832218edb017bf5ca7860707c41ea43233b8f 100644
--- a/tools/telemetry/telemetry/value/string.py
+++ b/tools/telemetry/telemetry/value/string.py
@@ -6,14 +6,15 @@ from telemetry import value as value_module
from telemetry.value import list_of_string_values
class StringValue(value_module.Value):
- def __init__(self, page, name, units, value, important=True):
+ def __init__(self, page, name, units, value, important=True,
+ description=None):
"""A single value (float, integer or string) result from a test.
A test that output a hash of the content in a page might produce a
string value:
StringValue(page, 'page_hash', 'hash', '74E377FF')
"""
- super(StringValue, self).__init__(page, name, units, important)
+ super(StringValue, self).__init__(page, name, units, important, description)
assert isinstance(value, basestring)
self.value = value
@@ -22,11 +23,13 @@ class StringValue(value_module.Value):
page_name = self.page.url
else:
page_name = None
- return 'ScalarValue(%s, %s, %s, %s, important=%s)' % (
+ return 'StringValue(%s, %s, %s, %s, important=%s, description=%s)' % (
page_name,
- self.name, self.units,
+ self.name,
+ self.units,
self.value,
- self.important)
+ self.important,
+ self.description)
def GetBuildbotDataType(self, output_context):
if self._IsImportantGivenOutputIntent(output_context):
« no previous file with comments | « tools/telemetry/telemetry/value/skip.py ('k') | tools/telemetry/telemetry/value/value_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698