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

Unified Diff: tracing/tracing/metrics/metric_map_function.html

Issue 2110683010: Allow benchmarks to specify running multiple metrics. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix style Created 4 years, 5 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: tracing/tracing/metrics/metric_map_function.html
diff --git a/tracing/tracing/metrics/metric_map_function.html b/tracing/tracing/metrics/metric_map_function.html
index bbfa316d77123dc07383f927770830d7e8f8d003..549e0d6a46b3c718aa8efa21f0a79936f616c1ba 100644
--- a/tracing/tracing/metrics/metric_map_function.html
+++ b/tracing/tracing/metrics/metric_map_function.html
@@ -23,16 +23,18 @@ tr.exportTo('tr.metrics', function() {
if (options === undefined)
throw new Error('Expected an options dict.');
- var metricName = options.metric;
- if (metricName === undefined)
- throw new Error('A metric name should be specified.');
+ var metricNames = options.metrics;
+ if (metricNames === undefined)
charliea (OOO until 10-5) 2016/07/06 17:41:05 Maybe add a check for if metricNames.length === 0?
+ throw new Error('Metric names should be specified.');
var values = new tr.v.ValueSet();
- var metric = tr.metrics.MetricRegistry.findTypeInfoWithName(metricName);
- if (metric === undefined)
- throw new Error('"' + metricName + '" is not a registered metric.');
- metric.constructor(values, model);
+ for (var metricName of metricNames) {
+ var metric = tr.metrics.MetricRegistry.findTypeInfoWithName(metricName);
+ if (metric === undefined)
+ throw new Error('"' + metricName + '" is not a registered metric.');
+ metric.constructor(values, model);
+ }
for (var metadata of model.metadata) {
if (!metadata.value || !metadata.value['iteration-info'])

Powered by Google App Engine
This is Rietveld 408576698