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

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

Issue 545523002: [Telemetry] Add capability for values to reference external files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better approach + more tests Created 6 years, 3 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
Index: tools/telemetry/telemetry/value/__init__.py
diff --git a/tools/telemetry/telemetry/value/__init__.py b/tools/telemetry/telemetry/value/__init__.py
index 8bba418e09af16f4afa2f7005597da594a1e3066..8d03d78eb218e6924ff3e596a19c56b3047386ff 100644
--- a/tools/telemetry/telemetry/value/__init__.py
+++ b/tools/telemetry/telemetry/value/__init__.py
@@ -42,7 +42,7 @@ SUMMARY_RESULT_OUTPUT_CONTEXT = 'summary-result-output-context'
class Value(object):
"""An abstract value produced by a telemetry page test.
"""
- def __init__(self, page, name, units, important, description):
+ def __init__(self, page, name, units, important, description, paths):
"""A generic Value object.
Args:
@@ -56,12 +56,17 @@ class Value(object):
by default in downstream UIs.
description: A string explaining in human-understandable terms what this
value represents.
+ paths: A list of paths corresponding to files associated with this value.
nednguyen 2014/09/08 18:45:24 What are paths? Are they strings, or are they inst
"""
self.page = page
self.name = name
self.units = units
self.important = important
self.description = description
+ if paths is None:
+ self.paths = []
+ else:
+ self.paths = paths
def IsMergableWith(self, that):
return (self.units == that.units and
@@ -187,6 +192,11 @@ class Value(object):
if self.page:
d['page_id'] = self.page.id
nduca 2014/09/08 18:53:02 How about ""Returns file handle... or none."""
+ if self.paths:
+ # Assigning IDs to paths is a serialization detail, so we defer updating
+ # this to an ID until we actually intend on serializing this value.
+ d['paths'] = self.paths
+
return d
def AsDictWithoutBaseClassEntries(self):

Powered by Google App Engine
This is Rietveld 408576698