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

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

Issue 941803002: Work around exceptions when the 'high' value for a histogram is not present. This happens when the … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added method in histogram_util to parse histogram buckets and correctly set 'high' value Created 5 years, 10 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/histogram.py
diff --git a/tools/telemetry/telemetry/value/histogram.py b/tools/telemetry/telemetry/value/histogram.py
index 64fadb0a833773175cee0e62f059748200f16bef..877e135e5403af2024720cd9f51f2d6f90dce7c3 100644
--- a/tools/telemetry/telemetry/value/histogram.py
+++ b/tools/telemetry/telemetry/value/histogram.py
@@ -37,10 +37,8 @@ class HistogramValue(value_module.Value):
'Don\'t specify both raw_value and raw_value_json'
raw_value = json.loads(raw_value_json)
if raw_value:
- assert 'buckets' in raw_value
- assert isinstance(raw_value['buckets'], list)
self.buckets = []
- for bucket in raw_value['buckets']:
+ for bucket in histogram_util.GetHistogramBucketsFromRawValue(raw_value):
self.buckets.append(HistogramValueBucket(
low=bucket['low'],
high=bucket['high'],
« no previous file with comments | « no previous file | tools/telemetry/telemetry/value/histogram_util.py » ('j') | tools/telemetry/telemetry/value/histogram_util.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698