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

Side by Side Diff: tracing/tracing/metrics/all_histogram_names.py

Issue 2656493002: Register metric Histogram names. (Closed)
Patch Set: rebase Created 3 years, 10 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
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import json
6 import os
7
8 import tracing_project
9 import vinn
10
11
12 _ALL_HISTOGRAM_NAMES_CMD_LINE = os.path.join(
13 os.path.dirname(__file__), 'all_histogram_names_cmdline.html')
14
15
16 def AllHistogramNames(metrics):
17 """ Returns a list of registered metrics.
18
19 Args:
20 metrics: a list of modules (string) to be loaded before discovering
21 the registered metrics.
22 """
23 assert isinstance(metrics, list)
24 project = tracing_project.TracingProject()
25 res = vinn.RunFile(
26 _ALL_HISTOGRAM_NAMES_CMD_LINE, source_paths=list(project.source_paths),
27 js_args=metrics)
28
29 if res.returncode != 0:
30 raise RuntimeError('Error running all_histogram_names_cmdline: ' +
31 res.stdout)
32 else:
33 return [str(m) for m in json.loads(res.stdout)]
OLDNEW
« no previous file with comments | « telemetry/telemetry/web_perf/timeline_based_measurement.py ('k') | tracing/tracing/metrics/all_histogram_names_cmdline.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698