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

Side by Side Diff: tracing/tracing/metrics/metric_registry.html

Issue 2052593005: Pass rangeOfInterest to metrics for the metrics side panel (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | tracing/tracing/metrics/system_health/long_tasks_metric.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 <link rel="import" href="/tracing/base/base.html"> 7 <link rel="import" href="/tracing/base/base.html">
8 <link rel="import" href="/tracing/base/extension_registry.html"> 8 <link rel="import" href="/tracing/base/extension_registry.html">
9 <link rel="import" href="/tracing/base/iteration_helpers.html"> 9 <link rel="import" href="/tracing/base/iteration_helpers.html">
10 10
11 <script> 11 <script>
12 'use strict'; 12 'use strict';
13 13
14 tr.exportTo('tr.metrics', function() { 14 tr.exportTo('tr.metrics', function() {
15 15
16 function MetricRegistry() {} 16 function MetricRegistry() {}
17 17
18 var options = new tr.b.ExtensionRegistryOptions(tr.b.BASIC_REGISTRY_MODE); 18 var options = new tr.b.ExtensionRegistryOptions(tr.b.BASIC_REGISTRY_MODE);
19 options.defaultMetadata = {}; 19 options.defaultMetadata = {};
20 tr.b.decorateExtensionRegistry(MetricRegistry, options); 20 tr.b.decorateExtensionRegistry(MetricRegistry, options);
21 21
22 MetricRegistry.addEventListener('will-register', function(e) { 22 MetricRegistry.addEventListener('will-register', function(e) {
23 var metric = e.typeInfo.constructor; 23 var metric = e.typeInfo.constructor;
24 if (!(metric instanceof Function)) 24 if (!(metric instanceof Function))
25 throw new Error('Metrics must be functions'); 25 throw new Error('Metrics must be functions');
26 26
27 if (metric.length !== 2) 27 if (metric.length < 2) {
28 throw new Error('Metrics take a ValueSet and a Model'); 28 throw new Error('Metrics take a ValueSet and a Model and ' +
29 'optionally an options dictionary');
30 }
29 }); 31 });
30 32
31 return { 33 return {
32 MetricRegistry: MetricRegistry 34 MetricRegistry: MetricRegistry
33 }; 35 };
34 }); 36 });
35 </script> 37 </script>
OLDNEW
« no previous file with comments | « no previous file | tracing/tracing/metrics/system_health/long_tasks_metric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698