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 import ts_mon |
| 11 |
| 12 metric1 = ts_mon.BooleanMetric('/my/metric1', description='metric1') |
| 13 metric2 = ts_mon.CounterMetric('/my/metric2', description='metric2') |
| 14 metric3 = ts_mon.CumulativeDistributionMetric('/my/metric3', |
| 15 description='metric3') |
| 16 metric4 = ts_mon.CumulativeMetric('/my/metric4', description='metric4') |
| 17 |
| 18 |
| 19 # Add a wrapping function to check that we're finding those as well. |
| 20 def nice_function(): |
| 21 # Checking that we really ignore comments. |
| 22 # ts_mon.FloatMetric('/my/metric11', description='metric11') |
| 23 |
| 24 metric6 = ts_mon.FloatMetric('/my/metric6', description='metric6') |
| 25 metric7 = ts_mon.GaugeMetric('/my/metric7', description='metric7') |
| 26 metric8 = ts_mon.NonCumulativeDistributionMetric('/my/metric8', |
| 27 description='metric8') |
| 28 metric9 = ts_mon.StringMetric('/my/metric9', description='metric9') |
| 29 # Use all variables to silence pylint. |
| 30 print metric6, metric7, metric8, metric9 |
| 31 |
| 32 |
| 33 # Some unrelated code to add noise |
| 34 if __name__ == '__main__': |
| 35 pass |
OLD | NEW |