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

Unified Diff: infra/libs/event_mon/config.py

Issue 875403010: event_mon: actually implemented push (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebased + fixed nits Created 5 years, 10 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 | « no previous file | infra/libs/event_mon/monitoring.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 cc2295e64468257734c9976eeeae3b8589a36d20..bbaa61b1db4c377e63b6cc9e44b6e0df224bfe74 100644
--- a/infra/libs/event_mon/config.py
+++ b/infra/libs/event_mon/config.py
@@ -17,9 +17,11 @@ cache = {}
def add_argparse_options(parser):
# The default values should make sense for local testing, not production.
- parser.add_argument('--event-mon-dry-run', type=bool, default=True,
- help='Whether events should be sent to the remote '
- 'server.')
+ parser.add_argument('--event-mon-run-type', default='dry',
+ choices=('dry', 'test', 'prod'),
+ help='Determine how to send data. "dry" does not send'
+ ' anything. "test" sends to the test endpoint, and '
+ '"prod" to the actual production endpoint.')
parser.add_argument('--event-mon-service-name',
help='Service name to use in log events.')
parser.add_argument('--event-mon-hostname',
@@ -45,7 +47,13 @@ def add_argparse_options(parser):
def process_argparse_options(args):
global _router
if not _router:
- _router = _Router(dry_run=args.event_mon_dry_run)
+ ENDPOINTS = {
+ 'dry': None,
+ 'test': 'https://jmt17.google.com/log',
+ 'prod': 'https://play.googleapis.com/log',
+ }
+ endpoint = ENDPOINTS.get(args.event_mon_run_type)
+ _router = _Router(endpoint=endpoint)
default_event = ChromeInfraEvent()
« no previous file with comments | « no previous file | infra/libs/event_mon/monitoring.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698