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
9<script>
10'use strict';
11
12function discoverMetrics(args) {
13  for (var i = 0; i < args.length; i++) {
14    var filename = args[i];
15    HTMLImportsLoader.loadHTML(filename);
16  }
17
18  var metrics = tr.metrics.MetricRegistry.getAllRegisteredTypeInfos();
19  var discovered_metric_names = [];
20  for (var i = 0; i < metrics.length; i++) {
21    discovered_metric_names.push(metrics[i].constructor.name);
22  }
23  console.log(JSON.stringify(discovered_metric_names));
24  return 0;
25}
26
27if (tr.isHeadless)
28  quit(discoverMetrics(sys.argv.slice(1)));
29
30</script>
31