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

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

Issue 1860753003: [Telemetry] Ignore non-scalar numerics for TBMv2 metrics (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Address Ned's comment Created 4 years, 8 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/sample_metric.html
diff --git a/tracing/tracing/metrics/sample_metric.html b/tracing/tracing/metrics/sample_metric.html
index 0ab92913413facdd3a004d172353bcd2ff41e6c0..c2171d8cb405bf9807fc6b07745f43838ba597ed 100644
--- a/tracing/tracing/metrics/sample_metric.html
+++ b/tracing/tracing/metrics/sample_metric.html
@@ -4,6 +4,7 @@ Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
+<link rel="import" href="/tracing/base/range.html">
<link rel="import" href="/tracing/metrics/metric_registry.html">
<link rel="import" href="/tracing/value/numeric.html">
<link rel="import" href="/tracing/value/value.html">
@@ -14,13 +15,19 @@ found in the LICENSE file.
tr.exportTo('tr.metrics', function() {
function sampleMetric(valueList, model) {
- var unit = tr.v.Unit.byName.sizeInBytes_smallerIsBetter;
- var n1 = new tr.v.ScalarNumeric(unit, 1);
- var n2 = new tr.v.ScalarNumeric(unit, 2);
+ var sizeInBytes_smallerIsBetter =
+ tr.v.Unit.byName.sizeInBytes_smallerIsBetter;
+ var n1 = new tr.v.ScalarNumeric(sizeInBytes_smallerIsBetter, 1);
+ var n2 = new tr.v.ScalarNumeric(sizeInBytes_smallerIsBetter, 2);
+ var n3 = new tr.v.Numeric.createLinear(
+ sizeInBytes_smallerIsBetter, tr.b.Range.fromExplicitRange(1, 100), 100);
+ n3.add(1);
valueList.addValue(new tr.v.NumericValue(
model.canonicalUrl, 'foo', n1));
valueList.addValue(new tr.v.NumericValue(
model.canonicalUrl, 'bar', n2));
+ valueList.addValue(new tr.v.NumericValue(
+ model.canonicalUrl, 'baz', n3));
}
sampleMetric.prototype = {
« no previous file with comments | « telemetry/telemetry/web_perf/timeline_based_page_test_unittest.py ('k') | tracing/tracing/value/numeric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698