Commit 4e9c5e04 authored by Mikhail Khokhlov's avatar Mikhail Khokhlov Committed by Commit Bot

[tools/perf] Introduce --experimental-tbmv3-metrics flag

We are going to turn proto trace generation on everywhere, but we are not
ready to run TBMv3 metrics on all platforms. This CL hides all the TBMv3
stuff behind a flag and sets this flag on linux-perf-fyi bot where we
test TBMv3 metrics.

Bug: 990304
Change-Id: I95f10acd6d287f5873e5c39755acde5ca0f007d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1980580Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/master@{#727267}
parent ca617a94
...@@ -193,7 +193,8 @@ ...@@ -193,7 +193,8 @@
"--upload-results", "--upload-results",
"--test-shard-map-filename=linux-perf-fyi_map.json", "--test-shard-map-filename=linux-perf-fyi_map.json",
"--output-format=histograms", "--output-format=histograms",
"--experimental-proto-trace-format" "--experimental-proto-trace-format",
"--experimental-tbmv3-metrics"
], ],
"isolate_name": "performance_test_suite", "isolate_name": "performance_test_suite",
"merge": { "merge": {
......
...@@ -148,6 +148,7 @@ FYI_BUILDERS = { ...@@ -148,6 +148,7 @@ FYI_BUILDERS = {
'extra_args': [ 'extra_args': [
'--output-format=histograms', '--output-format=histograms',
'--experimental-proto-trace-format', '--experimental-proto-trace-format',
'--experimental-tbmv3-metrics',
], ],
} }
], ],
......
...@@ -85,7 +85,9 @@ def ArgumentParser(standalone=False): ...@@ -85,7 +85,9 @@ def ArgumentParser(standalone=False):
'Supported values are: %s; or a valid cloud storage bucket name.' 'Supported values are: %s; or a valid cloud storage bucket name.'
% ', '.join(sorted(cloud_storage.BUCKET_ALIASES)), % ', '.join(sorted(cloud_storage.BUCKET_ALIASES)),
'Defaults to: %(default)s.')) 'Defaults to: %(default)s.'))
group.set_defaults(legacy_output_formats=[]) group.add_argument(
'--experimental-tbmv3-metrics', action='store_true',
help='Enable running experimental TBMv3 metrics.')
return parser return parser
......
...@@ -125,7 +125,6 @@ class TestProcessOptions(ProcessOptionsTestCase): ...@@ -125,7 +125,6 @@ class TestProcessOptions(ProcessOptionsTestCase):
def testDefaultOutputFormat(self): def testDefaultOutputFormat(self):
options = self.ParseArgs([]) options = self.ParseArgs([])
self.assertEqual(options.output_formats, ['html']) self.assertEqual(options.output_formats, ['html'])
self.assertEqual(options.legacy_output_formats, [])
def testUnkownOutputFormatRaises(self): def testUnkownOutputFormatRaises(self):
with self.assertRaises(SystemExit): with self.assertRaises(SystemExit):
......
...@@ -65,24 +65,26 @@ def ProcessResults(options): ...@@ -65,24 +65,26 @@ def ProcessResults(options):
# and make this an error. # and make this an error.
logging.warning('No test results to process.') logging.warning('No test results to process.')
upload_bucket = options.upload_bucket
results_label = options.results_label
max_num_values = options.max_values_per_test_case
test_path_format = options.test_path_format
trace_processor_path = options.trace_processor_path
test_suite_start = (test_results[0]['startTime'] test_suite_start = (test_results[0]['startTime']
if test_results and 'startTime' in test_results[0] if test_results and 'startTime' in test_results[0]
else datetime.datetime.utcnow().isoformat() + 'Z') else datetime.datetime.utcnow().isoformat() + 'Z')
run_identifier = RunIdentifier(results_label, test_suite_start) run_identifier = RunIdentifier(options.results_label, test_suite_start)
should_compute_metrics = any( should_compute_metrics = any(
fmt in FORMATS_WITH_METRICS for fmt in options.output_formats) fmt in FORMATS_WITH_METRICS for fmt in options.output_formats)
begin_time = time.time() begin_time = time.time()
util.ApplyInParallel( util.ApplyInParallel(
lambda result: ProcessTestResult( lambda result: ProcessTestResult(
result, upload_bucket, results_label, run_identifier, test_result=result,
test_suite_start, should_compute_metrics, max_num_values, upload_bucket=options.upload_bucket,
test_path_format, trace_processor_path), results_label=options.results_label,
run_identifier=run_identifier,
test_suite_start=test_suite_start,
should_compute_metrics=should_compute_metrics,
max_num_values=options.max_values_per_test_case,
test_path_format=options.test_path_format,
trace_processor_path=options.trace_processor_path,
enable_tbmv3=options.experimental_tbmv3_metrics),
test_results, test_results,
on_failure=util.SetUnexpectedFailure, on_failure=util.SetUnexpectedFailure,
) )
...@@ -120,17 +122,20 @@ def _AmortizeProcessingDuration(processing_duration, test_results): ...@@ -120,17 +122,20 @@ def _AmortizeProcessingDuration(processing_duration, test_results):
def ProcessTestResult(test_result, upload_bucket, results_label, def ProcessTestResult(test_result, upload_bucket, results_label,
run_identifier, test_suite_start, should_compute_metrics, run_identifier, test_suite_start, should_compute_metrics,
max_num_values, test_path_format, trace_processor_path): max_num_values, test_path_format, trace_processor_path,
enable_tbmv3):
ConvertProtoTraces(test_result, trace_processor_path) ConvertProtoTraces(test_result, trace_processor_path)
AggregateTBMv2Traces(test_result) AggregateTBMv2Traces(test_result)
AggregateTBMv3Traces(test_result) if enable_tbmv3:
AggregateTBMv3Traces(test_result)
if upload_bucket is not None: if upload_bucket is not None:
UploadArtifacts(test_result, upload_bucket, run_identifier) UploadArtifacts(test_result, upload_bucket, run_identifier)
if should_compute_metrics: if should_compute_metrics:
test_result['_histograms'] = histogram_set.HistogramSet() test_result['_histograms'] = histogram_set.HistogramSet()
compute_metrics.ComputeTBMv2Metrics(test_result) compute_metrics.ComputeTBMv2Metrics(test_result)
compute_metrics.ComputeTBMv3Metrics(test_result, trace_processor_path) if enable_tbmv3:
compute_metrics.ComputeTBMv3Metrics(test_result, trace_processor_path)
ExtractMeasurements(test_result) ExtractMeasurements(test_result)
num_values = len(test_result['_histograms']) num_values = len(test_result['_histograms'])
if max_num_values is not None and num_values > max_num_values: if max_num_values is not None and num_values > max_num_values:
......
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