aboutsummaryrefslogtreecommitdiff
path: root/tools_webrtc
diff options
context:
space:
mode:
authorPatrik Höglund <phoglund@webrtc.org>2020-03-17 09:59:10 +0100
committerPatrik Höglund <phoglund@webrtc.org>2020-03-17 09:35:02 +0000
commit620bed1c71a4ce42bb00307a416e54e5a2c62ad1 (patch)
treeb490e2af084b5d9e00270ad9fb4fdbea73081139 /tools_webrtc
parentba9e1b8b75f356eedd2972d95e20bb102779b957 (diff)
downloadwebrtc-620bed1c71a4ce42bb00307a416e54e5a2c62ad1.tar.gz
Remove allbins and story hacks, fix -Infinity.
The problem that has stopped the uploads from working is likely that json.dump writes -Infinity when encountering float('-inf'), but not all JSON parsers handle that. Notably, the dashboard JSON library doesn't when running in compressing mode. I think the real fix is to land the float->double CL for the histogram proto - I think we will not get float('inf') values then. Apply this hack in the meantime. Also remove allbins and story hacks, they're likely worse than the defaults anyway. Bug: chromium:1029452 Tbr: mbonadei@webrtc.org Change-Id: I98e36307cc144bbe6878ba9d93c0a609cab71418 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170626 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30808}
Diffstat (limited to 'tools_webrtc')
-rw-r--r--tools_webrtc/perf/catapult_uploader.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools_webrtc/perf/catapult_uploader.py b/tools_webrtc/perf/catapult_uploader.py
index 4d5ff88f65..96d1080d45 100644
--- a/tools_webrtc/perf/catapult_uploader.py
+++ b/tools_webrtc/perf/catapult_uploader.py
@@ -13,6 +13,7 @@ import json
import subprocess
import zlib
+from tracing.value import histogram
from tracing.value import histogram_set
from tracing.value.diagnostics import generic_set
from tracing.value.diagnostics import reserved_infos
@@ -58,14 +59,17 @@ def _SendHistogramSet(url, histograms, oauth_token):
# TODO(https://crbug.com/1029452): HACKHACK
-# Remove once we set bin bounds correctly in the proto writer.
+# Remove once we have doubles in the proto and handle -infinity correctly.
def _ApplyHacks(dicts):
for d in dicts:
- if 'name' in d:
- d['allBins'] = [[1]]
- del d['binBoundaries']
- d['diagnostics']['stories']['values'][0] = (
- d['diagnostics']['stories']['values'][0].replace('/', '_'))
+ if 'running' in d:
+ def _NoInf(value):
+ if value == float('inf'):
+ return histogram.JS_MAX_VALUE
+ if value == float('-inf'):
+ return -histogram.JS_MAX_VALUE
+ return value
+ d['running'] = [_NoInf(value) for value in d['running']]
return dicts
@@ -101,8 +105,8 @@ def _DumpOutput(histograms, output_file):
# TODO(https://crbug.com/1029452): Remove this once
# https://chromium-review.googlesource.com/c/catapult/+/2094312 lands.
def _HackSummaryOptions(histograms):
- for histogram in histograms:
- histogram.CustomizeSummaryOptions({
+ for h in histograms:
+ h.CustomizeSummaryOptions({
'avg': False,
'std': False,
'count': False,