1<!DOCTYPE html>
2<!--
3Copyright 2016 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7<link rel="import" href="/tracing/metrics/metric_registry.html">
8<link rel="import" href="/tracing/value/numeric.html">
9<link rel="import" href="/tracing/value/value.html">
10
11<script>
12'use strict';
13
14tr.exportTo('tr.metrics', function() {
15
16  function sampleMetric(valueList, model) {
17    var unit = tr.v.Unit.byName.sizeInBytes_smallerIsBetter;
18    var n1 = new tr.v.ScalarNumeric(unit, 1);
19    var n2 = new tr.v.ScalarNumeric(unit, 2);
20    valueList.addValue(new tr.v.NumericValue(
21        model.canonicalUrlThatCreatedThisTrace, 'foo', n1));
22    valueList.addValue(new tr.v.NumericValue(
23        model.canonicalUrlThatCreatedThisTrace, 'bar', n2));
24  }
25
26  sampleMetric.prototype = {
27    __proto__: Function.prototype
28  };
29
30  tr.metrics.MetricRegistry.register(sampleMetric);
31
32  return {
33    sampleMetric: sampleMetric
34  };
35});
36</script>
37