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

Side by Side Diff: infra/tools/metric_tool/test/data/normal_case_2.py

Issue 1368583005: Create metric_tool to deal with metric definitions (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 5 years, 2 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 2015 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 """Example containing all metrics, all with descriptions.
6
7 Tests assume the description contains the name of the metric, without
8 the prefix.
9 """
10 from infra_libs.ts_mon import BooleanMetric, CounterMetric
11 from infra_libs.ts_mon import CumulativeDistributionMetric, CumulativeMetric
12 from infra_libs.ts_mon import DistributionMetric, FloatMetric
13 from infra_libs.ts_mon import GaugeMetric, NonCumulativeDistributionMetric
14 from infra_libs.ts_mon import StringMetric
15
16
17 metric1 = BooleanMetric('/my/metric1', description='metric1')
18 metric2 = CounterMetric('/my/metric2', description='metric2')
19 metric3 = CumulativeDistributionMetric('/my/metric3',
20 description='metric3')
21 metric4 = CumulativeMetric('/my/metric4', description='metric4')
22
23
24 # Add a wrapping function to check that we're finding those as well.
25 def nice_function():
26 # Checking that we really ignore comments.
27 # FloatMetric('/my/metric11', description='metric11')
28
29 metric6 = FloatMetric('/my/metric6', description='metric6')
30 metric7 = GaugeMetric('/my/metric7', description='metric7')
31 metric8 = NonCumulativeDistributionMetric('/my/metric8',
32 description='metric8')
33 metric9 = StringMetric('/my/metric9', description='metric9')
34 # Use all variables to silence pylint.
35 print metric6, metric7, metric8, metric9
36
37
38 # Some unrelated code to add noise
39 if __name__ == '__main__':
40 pass
OLDNEW
« no previous file with comments | « infra/tools/metric_tool/test/data/normal_case.py ('k') | infra/tools/metric_tool/test/data/other_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698