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

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

Issue 2055043002: Plumb IterationInfo from telemetry to a diagnostic (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: IterationInfo python class Created 4 years, 6 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
« no previous file with comments | « tracing/trace_viewer.gypi ('k') | tracing/tracing/metrics/metric_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 644574394867e6a5341385392c9534db8daf2a04..a460c99f6d11fa906feea1941bf62a4dd4f8d50a 100644
--- a/tracing/tracing/metrics/metric_map_function.html
+++ b/tracing/tracing/metrics/metric_map_function.html
@@ -14,18 +14,35 @@ found in the LICENSE file.
'use strict';
tr.exportTo('tr.metrics', function() {
+ /**
+ * @param {!pi.mre.MreResult} result
+ * @param {!tr.model.Model} model
+ * @param {!Object} options
+ */
function metricMapFunction(result, model, options) {
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 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);
+ // Values can be separated from their ValueSet and mixed into ValueSets with
+ // Values from other iterations, so add IterationInfo to each Value.
+ if (options.iterInfo) {
+ var iterInfo = new tr.v.d.IterationInfo(options.iterInfo);
+ values.map(function(value) {
+ value.diagnostics.add('iterInfo', iterInfo);
+ });
+ }
+
result.addPair('values', values.valueDicts);
}
« no previous file with comments | « tracing/trace_viewer.gypi ('k') | tracing/tracing/metrics/metric_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698