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

Side by Side Diff: infra_libs/event_mon/config.py

Issue 1939863002: Use correct types for the command line arguments (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import socket 7 import socket
8 8
9 import infra_libs 9 import infra_libs
10 from infra_libs.event_mon.protos.chrome_infra_log_pb2 import ( 10 from infra_libs.event_mon.protos.chrome_infra_log_pb2 import (
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 help="Path to a json file containing a service account's" 57 help="Path to a json file containing a service account's"
58 "\ncredentials. This is relative to the path specified\n" 58 "\ncredentials. This is relative to the path specified\n"
59 "in --event-mon-service-accounts-creds-root\n" 59 "in --event-mon-service-accounts-creds-root\n"
60 "Defaults to '%(default)s'") 60 "Defaults to '%(default)s'")
61 group.add_argument('--event-mon-service-accounts-creds-root', 61 group.add_argument('--event-mon-service-accounts-creds-root',
62 metavar='DIR', 62 metavar='DIR',
63 default=infra_libs.SERVICE_ACCOUNTS_CREDS_ROOT, 63 default=infra_libs.SERVICE_ACCOUNTS_CREDS_ROOT,
64 help="Directory containing service accounts credentials.\n" 64 help="Directory containing service accounts credentials.\n"
65 "Defaults to %(default)s" 65 "Defaults to %(default)s"
66 ) 66 )
67 group.add_argument('--event-mon-http-timeout', default=10, 67 group.add_argument('--event-mon-http-timeout', default=10, type=int,
68 help='Timeout in seconds for HTTP requests to send events') 68 help='Timeout in seconds for HTTP requests to send events')
69 group.add_argument('--event-mon-http-retry-backoff', default=2., 69 group.add_argument('--event-mon-http-retry-backoff', default=2., type=float,
70 help='Time in seconds before retrying POSTing to the HTTP ' 70 help='Time in seconds before retrying POSTing to the HTTP '
71 'endpoint. Randomized exponential backoff is applied on ' 71 'endpoint. Randomized exponential backoff is applied on '
72 'subsequent retries.') 72 'subsequent retries.')
73 73
74 74
75 def process_argparse_options(args): # pragma: no cover 75 def process_argparse_options(args): # pragma: no cover
76 """Initializes event monitoring based on provided arguments. 76 """Initializes event monitoring based on provided arguments.
77 77
78 Args: 78 Args:
79 args(argparse.Namespace): output of ArgumentParser.parse_args. 79 args(argparse.Namespace): output of ArgumentParser.parse_args.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 Call this right before exiting the program. 222 Call this right before exiting the program.
223 223
224 Returns: 224 Returns:
225 success (bool): False if an error occured 225 success (bool): False if an error occured
226 """ 226 """
227 global _router, _cache 227 global _router, _cache
228 _router = None 228 _router = None
229 _cache = {} 229 _cache = {}
230 return True 230 return True
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698