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

Unified Diff: client/third_party/infra_libs/ts_mon/common/errors.py

Issue 2705273003: Roll infra_libs and gae_ts_mon in luci-py, and add field_specs to all metrics (Closed)
Patch Set: Rebase Created 3 years, 9 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: client/third_party/infra_libs/ts_mon/common/errors.py
diff --git a/client/third_party/infra_libs/ts_mon/common/errors.py b/client/third_party/infra_libs/ts_mon/common/errors.py
index 0784a579791600fad4a816389a870d0f9510f947..3bf76315ce16340f840863e648bf96def7834b99 100644
--- a/client/third_party/infra_libs/ts_mon/common/errors.py
+++ b/client/third_party/infra_libs/ts_mon/common/errors.py
@@ -125,3 +125,20 @@ class UnknownModificationTypeError(MonitoringError):
def __str__(self):
return 'Unknown modification type "%s"' % self.mod_type
+
+
+class MetricDefinitionError(MonitoringError):
+ """Raised when a metric was defined incorrectly."""
+
+
+class WrongFieldsError(MonitoringError):
+ """Raised when a metric is given different fields to its definition."""
+
+ def __init__(self, metric_name, got, expected):
+ self.metric_name = metric_name
+ self.got = got
+ self.expected = expected
+
+ def __str__(self):
+ return 'Metric "%s" is defined with %s fields but was given %s' % (
+ self.metric_name, self.expected, self.got)
« no previous file with comments | « client/third_party/infra_libs/ts_mon/__init__.py ('k') | client/third_party/infra_libs/ts_mon/common/http_metrics.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698