Commit 33b09511 authored by Mikhail Khokhlov's avatar Mikhail Khokhlov Committed by Commit Bot

[tools/perf] Stop reading pre-calculated histograms

Saving histograms as an artifact in Telemetry and reading them in
Results Processor was a temporary measure to make transition
more smooth. Now it's time to remove it.

Bug: 981349
Change-Id: Ib303177903456e8d81aae9de89c47117c96cd7e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900990Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/master@{#713422}
parent ba0cf22f
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import json
import logging import logging
import os import os
import time import time
...@@ -15,14 +14,6 @@ from tracing.metrics import metric_runner ...@@ -15,14 +14,6 @@ from tracing.metrics import metric_runner
# Aggregated trace is saved under this name. # Aggregated trace is saved under this name.
HTML_TRACE_NAME = 'trace.html' HTML_TRACE_NAME = 'trace.html'
# Results of metric computation are stored under this key in test_results.
HISTOGRAM_DICTS_KEY = 'histogram_dicts'
# This file is written by telemetry, it contains output of metric computation.
# This is a temporary hack to keep things working while we gradually move
# code from Telemetry to Results Processor.
HISTOGRAM_DICTS_FILE = 'histogram_dicts.json'
def _RunMetric(test_result): def _RunMetric(test_result):
metrics = [tag['value'] for tag in test_result['tags'] metrics = [tag['value'] for tag in test_result['tags']
...@@ -61,18 +52,9 @@ def ComputeTBMv2Metrics(test_result): ...@@ -61,18 +52,9 @@ def ComputeTBMv2Metrics(test_result):
For each test run that has an aggregate trace and some TBMv2 metrics listed For each test run that has an aggregate trace and some TBMv2 metrics listed
in its tags, compute the metrics and return the list of all resulting in its tags, compute the metrics and return the list of all resulting
histograms. Note: the order of histograms in the results may be different histograms.
from the order of tests in intermediate_results.
""" """
artifacts = test_result.get('outputArtifacts', {}) artifacts = test_result.get('outputArtifacts', {})
# TODO(crbug.com/981349): If metrics have already been computed in
# Telemetry, we read it from the file. Remove this branch after Telemetry
# does not compute metrics anymore.
if HISTOGRAM_DICTS_FILE in artifacts:
with open(artifacts[HISTOGRAM_DICTS_FILE]['filePath']) as f:
test_result['_histograms'].ImportDicts(json.load(f))
del artifacts[HISTOGRAM_DICTS_FILE]
return
if test_result['status'] == 'SKIP': if test_result['status'] == 'SKIP':
return return
...@@ -85,7 +67,6 @@ def ComputeTBMv2Metrics(test_result): ...@@ -85,7 +67,6 @@ def ComputeTBMv2Metrics(test_result):
/ (2 ** 20)) / (2 ** 20))
# Bails out on traces that are too big. See crbug.com/812631 for more # Bails out on traces that are too big. See crbug.com/812631 for more
# details. # details.
# TODO(crbug.com/1010041): Return a non-zero exit code in this case.
if trace_size_in_mib > 400: if trace_size_in_mib > 400:
util.SetUnexpectedFailure(test_result) util.SetUnexpectedFailure(test_result)
logging.error('%s: Trace size is too big: %s MiB', logging.error('%s: Trace size is too big: %s MiB',
......
...@@ -199,11 +199,9 @@ def UploadArtifacts(test_result, upload_bucket, run_identifier): ...@@ -199,11 +199,9 @@ def UploadArtifacts(test_result, upload_bucket, run_identifier):
for name, artifact in artifacts.iteritems(): for name, artifact in artifacts.iteritems():
if 'remoteUrl' in artifact: if 'remoteUrl' in artifact:
continue continue
# TODO(crbug.com/981349): Remove check for HISTOGRAM_DICTS_FILE # TODO(crbug.com/981349): Think of a more general way to
# after Telemetry does not save histograms as an artifact anymore.
# Another TODO(crbug.com/981349): Think of a more general way to
# specify which artifacts deserve uploading. # specify which artifacts deserve uploading.
if name in [compute_metrics.HISTOGRAM_DICTS_FILE, MEASUREMENTS_NAME]: if name == MEASUREMENTS_NAME:
continue continue
remote_name = '/'.join([run_identifier, test_result['testPath'], name]) remote_name = '/'.join([run_identifier, test_result['testPath'], name])
urlsafe_remote_name = re.sub(r'[^A-Za-z0-9/.-]+', '_', remote_name) urlsafe_remote_name = re.sub(r'[^A-Za-z0-9/.-]+', '_', remote_name)
......
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