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

Unified Diff: infra_libs/event_mon/config.py

Issue 1407143009: Added event_mon.set_default_event (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 2 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_libs/event_mon/__init__.py ('k') | infra_libs/event_mon/test/config_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra_libs/event_mon/config.py
diff --git a/infra_libs/event_mon/config.py b/infra_libs/event_mon/config.py
index df898d3afb9ed83fdb1ec0bd342485325b919bc5..438bc2fc76f60ea020890e27b354d574aafab233 100644
--- a/infra_libs/event_mon/config.py
+++ b/infra_libs/event_mon/config.py
@@ -165,6 +165,20 @@ def setup_monitoring(run_type='dry',
dry_run=dry_run)
+def set_default_event(event):
+ """Change the default ChromeInfraEvent used to compute all events.
+
+ Args:
+ event (ChromeInfraEvent): default event
+ """
+ if not isinstance(event, ChromeInfraEvent):
+ logging.error('A ChromeInfraEvent is required as the default event. Got %s',
dsansome 2015/10/29 00:51:54 Feels like you ought to raise a TypeError or Value
pgervais 2015/10/29 17:11:24 Done.
+ type(event))
+ return
+
+ _cache['default_event'] = event
+
+
def close():
"""Reset the state.
« no previous file with comments | « infra_libs/event_mon/__init__.py ('k') | infra_libs/event_mon/test/config_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698