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

Unified Diff: infra/tools/metric_tool/test/data/normal_case.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, 3 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 side-by-side diff with in-line comments
Download patch
Index: infra/tools/metric_tool/test/data/normal_case.py
diff --git a/infra/tools/metric_tool/test/data/normal_case.py b/infra/tools/metric_tool/test/data/normal_case.py
new file mode 100644
index 0000000000000000000000000000000000000000..5a756a7aa315ccee538f1a9f32851ba8ce736e1a
--- /dev/null
+++ b/infra/tools/metric_tool/test/data/normal_case.py
@@ -0,0 +1,35 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Example containing all metrics, all with descriptions.
+
+Tests assume the description contains the name of the metric, without
+the prefix.
+"""
+from infra_libs import ts_mon
+
+metric1 = ts_mon.BooleanMetric('/my/metric1', description='metric1')
+metric2 = ts_mon.CounterMetric('/my/metric2', description='metric2')
+metric3 = ts_mon.CumulativeDistributionMetric('/my/metric3',
+ description='metric3')
+metric4 = ts_mon.CumulativeMetric('/my/metric4', description='metric4')
+
+
+# Add a wrapping function to check that we're finding those as well.
+def nice_function():
+ # Checking that we really ignore comments.
+ # ts_mon.FloatMetric('/my/metric11', description='metric11')
+
+ metric6 = ts_mon.FloatMetric('/my/metric6', description='metric6')
+ metric7 = ts_mon.GaugeMetric('/my/metric7', description='metric7')
+ metric8 = ts_mon.NonCumulativeDistributionMetric('/my/metric8',
+ description='metric8')
+ metric9 = ts_mon.StringMetric('/my/metric9', description='metric9')
+ # Use all variables to silence pylint.
+ print metric6, metric7, metric8, metric9
+
+
+# Some unrelated code to add noise
+if __name__ == '__main__':
+ pass
« no previous file with comments | « infra/tools/metric_tool/test/data/missing_descriptions.py ('k') | infra/tools/metric_tool/test/data/normal_case_2.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698