Commit 671499f4 authored by Jamie Madill's avatar Jamie Madill Committed by Commit Bot

Revert "Add multi results in legacy perf dashboard script."

This reverts commit 3ca3fb27.

Reason for revert:
Seems to be the incorrect way to handle multi-results. Instead of
returning an array of values, we should compute the average and return
a standard deviation as the last result.

https://chromeperf.appspot.com/report?sid=3b11bf2aa2cf2281472588fed4dfc1e0a9f514ff10bd9db09cb208c5306ac3c9

Original change's description:
> Add multi results in legacy perf dashboard script.
> 
> Currently when the script reads multiple results it outputs the
> last value read as well as a zero placehold for standard deviation.
> 
> According to benjhayden@ we can return all results in an array.
> This change does just that and adds a test. It also updates the
> expected unit test output.
> 
> Bug: 900677
> Change-Id: Icc38808ea83caddbdf6b8582e2ddc34db4f8cdf0
> Reviewed-on: https://chromium-review.googlesource.com/c/1338468
> Reviewed-by: Ned Nguyen <nednguyen@google.com>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#608882}

TBR=jmadill@chromium.org,benjhayden@chromium.org,nednguyen@google.com,eyaich@chromium.org

Change-Id: I24fe0fae6607bf4d1bf8fb55d2c4f78d18a74b71
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 900677
Reviewed-on: https://chromium-review.googlesource.com/c/1341087Reviewed-by: default avatarJamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609076}
parent 4dd1288f
......@@ -73,9 +73,15 @@ class LegacyResultsProcessor(object):
def __init__(self):
self.important = False
self.values = []
self.value = 0.0
self.stddev = 0.0
def __str__(self):
result = _FormatHumanReadable(self.value)
if self.stddev:
result += '+/-%s' % _FormatHumanReadable(self.stddev)
return result
class Graph(object):
"""Encapsulates a set of points that should appear on the same graph."""
......@@ -94,7 +100,7 @@ class LegacyResultsProcessor(object):
"""Returns a dictionary mapping trace names to [value, stddev]."""
traces_dict = {}
for name, trace in self.traces.items():
traces_dict[name] = trace.values
traces_dict[name] = [str(trace.value), str(trace.stddev)]
return traces_dict
......@@ -135,39 +141,37 @@ class LegacyResultsProcessor(object):
graph = self._graphs.get(graph_name, self.Graph())
graph.units = (match_dict['UNITS'] or '').strip()
trace = graph.traces.get(trace_name, self.Trace())
value = match_dict['VALUE']
trace.value = match_dict['VALUE']
trace.important = match_dict['IMPORTANT'] or False
# Compute the mean and standard deviation for a list or a histogram,
# or the numerical value of a scalar value.
if value.startswith('['):
if trace.value.startswith('['):
try:
value_list = [float(x) for x in value.strip('[],').split(',')]
value_list = [float(x) for x in trace.value.strip('[],').split(',')]
except ValueError:
# Report, but ignore, corrupted data lines. (Lines that are so badly
# broken that they don't even match the RESULTS_REGEX won't be
# detected.)
logging.warning("Bad test output: '%s'" % value.strip())
logging.warning("Bad test output: '%s'" % trace.value.strip())
return
value, trace.stddev, filedata = self._CalculateStatistics(
trace.value, trace.stddev, filedata = self._CalculateStatistics(
value_list, trace_name)
assert filedata is not None
for filename in filedata:
self._PrependLog(filename, filedata[filename])
trace.values += value_list
elif value.startswith('{'):
stripped = value.strip('{},')
elif trace.value.startswith('{'):
stripped = trace.value.strip('{},')
try:
value, trace.stddev = [float(x) for x in stripped.split(',')]
trace.value, trace.stddev = [float(x) for x in stripped.split(',')]
except ValueError:
logging.warning("Bad test output: '%s'" % value.strip())
logging.warning("Bad test output: '%s'" % trace.value.strip())
return
trace.values.append(value)
else:
try:
trace.values.append(float(value))
trace.value = float(trace.value)
except ValueError:
logging.warning("Bad test output: '%s'" % value.strip())
logging.warning("Bad test output: '%s'" % trace.value.strip())
return
graph.traces[trace_name] = trace
......
{"traces": {"trace_with_multiple_samples": [100.0, 200.0, 300.0, 400.0], "trace_with_one_sample": [177.0], "trace_with_one_sample_comma": [177.0], "trace_with_three_samples": [100.0, 120.0, 200.0], "trace_with_three_samples_comma": [100.0, 120.0, 200.0]}, "units": "you-nits"}
\ No newline at end of file
{"traces": {"trace_with_one_sample": ["177.0", "0.0"], "trace_with_one_sample_comma": ["177.0", "0.0"], "trace_with_three_samples": ["140.0", "43.2049379894"], "trace_with_three_samples_comma": ["140.0", "43.2049379894"]}, "units": "you-nits"}
{"important": ["12t_cc", "1t_cc", "1t_cc_ref", "5t_cc"], "traces": {"12t_cc": [50200.0], "1t_cc": [22536.0], "1t_cc_ref": [22536.0], "5t_cc": [49412.0]}, "units": "kb"}
\ No newline at end of file
{"traces": {"12t_cc": ["50200.0", "0.0"], "1t_cc": ["22536.0", "0.0"], "1t_cc_ref": ["22536.0", "0.0"], "5t_cc": ["49412.0", "0.0"]}, "important": ["12t_cc", "1t_cc", "1t_cc_ref", "5t_cc"], "units": "kb"}
......@@ -47,10 +47,3 @@ RESULT artificial_graph: trace_with_one_sample= [177.0] you-nits
RESULT artificial_graph: trace_with_one_sample_comma= [177.0,] you-nits
RESULT artificial_graph: trace_with_three_samples= [100.0,120.0,200.0] you-nits
RESULT artificial_graph: trace_with_three_samples_comma= [100.0,120.0,200.0,] you-nits
# Artificial log output to test multiple results with the same name
RESULT artificial_graph: trace_with_multiple_samples= 100 you-nits
RESULT artificial_graph: trace_with_multiple_samples= 200 you-nits
RESULT artificial_graph: trace_with_multiple_samples= 300 you-nits
RESULT artificial_graph: trace_with_multiple_samples= 400 you-nits
{"traces": {"12t_proc": [3.0], "1t_proc": [2.0], "1t_proc_ref": [1.0], "5t_proc": [3.0]}, "units": ""}
\ No newline at end of file
{"traces": {"1t_proc": ["2.0", "0.0"], "1t_proc_ref": ["1.0", "0.0"], "12t_proc": ["3.0", "0.0"], "5t_proc": ["3.0", "0.0"]}, "units": ""}
{"traces": {"12t_vm_b": [10556.0], "1t_vm_b": [8712.0], "1t_vm_b_ref": [5712.0], "5t_vm_b": [10404.0]}, "units": "kb"}
\ No newline at end of file
{"traces": {"1t_vm_b": ["8712.0", "0.0"], "1t_vm_b_ref": ["5712.0", "0.0"], "12t_vm_b": ["10556.0", "0.0"], "5t_vm_b": ["10404.0", "0.0"]}, "units": "kb"}
{"traces": {"12t_vm": [55740.0], "1t_vm": [29696.0], "1t_vm_ref": [9696.0], "5t_vm": [54936.0]}, "units": "kb"}
\ No newline at end of file
{"traces": {"1t_vm": ["29696.0", "0.0"], "1t_vm_ref": ["9696.0", "0.0"], "12t_vm": ["55740.0", "0.0"], "5t_vm": ["54936.0", "0.0"]}, "units": "kb"}
{"traces": {"12t_ws_b": [18612.0], "1t_ws_b": [16892.0], "1t_ws_b_ref": [26892.0], "5t_ws_b": [18504.0]}, "units": "kb"}
\ No newline at end of file
{"traces": {"1t_ws_b": ["16892.0", "0.0"], "1t_ws_b_ref": ["26892.0", "0.0"], "12t_ws_b": ["18612.0", "0.0"], "5t_ws_b": ["18504.0", "0.0"]}, "units": "kb"}
{"important": ["12t_ws", "1t_ws", "1t_ws_ref", "5t_ws"], "traces": {"12t_ws": [63984.0], "1t_ws": [41960.0], "1t_ws_ref": [41960.0], "5t_ws": [63276.0]}, "units": "kb"}
\ No newline at end of file
{"traces": {"12t_ws": ["63984.0", "0.0"], "1t_ws": ["41960.0", "0.0"], "1t_ws_ref": ["41960.0", "0.0"], "5t_ws": ["63276.0", "0.0"]}, "important": ["12t_ws", "1t_ws", "1t_ws_ref", "5t_ws"], "units": "kb"}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment