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

Unified 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, 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/tools/metric_tool/test/data/normal_case_2.py
diff --git a/infra/tools/metric_tool/test/data/normal_case_2.py b/infra/tools/metric_tool/test/data/normal_case_2.py
new file mode 100644
index 0000000000000000000000000000000000000000..904f3d0c8ac74de0214ab19e0f4b851b88f77694
--- /dev/null
+++ b/infra/tools/metric_tool/test/data/normal_case_2.py
@@ -0,0 +1,40 @@
+# 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.ts_mon import BooleanMetric, CounterMetric
+from infra_libs.ts_mon import CumulativeDistributionMetric, CumulativeMetric
+from infra_libs.ts_mon import DistributionMetric, FloatMetric
+from infra_libs.ts_mon import GaugeMetric, NonCumulativeDistributionMetric
+from infra_libs.ts_mon import StringMetric
+
+
+metric1 = BooleanMetric('/my/metric1', description='metric1')
+metric2 = CounterMetric('/my/metric2', description='metric2')
+metric3 = CumulativeDistributionMetric('/my/metric3',
+ description='metric3')
+metric4 = 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.
+ # FloatMetric('/my/metric11', description='metric11')
+
+ metric6 = FloatMetric('/my/metric6', description='metric6')
+ metric7 = GaugeMetric('/my/metric7', description='metric7')
+ metric8 = NonCumulativeDistributionMetric('/my/metric8',
+ description='metric8')
+ metric9 = 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/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