OLD | NEW |
(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 |
OLD | NEW |