| OLD | NEW |
| 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 json | 5 import json |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import socket | 8 import socket |
| 9 import sys | 9 import sys |
| 10 import urlparse | 10 import urlparse |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 parser.add_argument( | 168 parser.add_argument( |
| 169 '--ts-mon-metric-name-prefix', | 169 '--ts-mon-metric-name-prefix', |
| 170 default='/chrome/infra/', | 170 default='/chrome/infra/', |
| 171 help='metric name prefix for all metrics (default: %(default)s)') | 171 help='metric name prefix for all metrics (default: %(default)s)') |
| 172 | 172 |
| 173 parser.add_argument( | 173 parser.add_argument( |
| 174 '--ts-mon-use-new-proto', | 174 '--ts-mon-use-new-proto', |
| 175 default=False, action='store_true', | 175 default=False, action='store_true', |
| 176 help='use the new proto schema (default: false)') | 176 help='use the new proto schema (default: false)') |
| 177 | 177 |
| 178 |
| 178 def process_argparse_options(args): | 179 def process_argparse_options(args): |
| 179 """Process command line arguments to initialize the global monitor. | 180 """Process command line arguments to initialize the global monitor. |
| 180 | 181 |
| 181 Also initializes the default target. | 182 Also initializes the default target. |
| 182 | 183 |
| 183 Starts a background thread to automatically flush monitoring metrics if not | 184 Starts a background thread to automatically flush monitoring metrics if not |
| 184 disabled by command line arguments. | 185 disabled by command line arguments. |
| 185 | 186 |
| 186 Args: | 187 Args: |
| 187 args (argparse.Namespace): the result of parsing the command line arguments | 188 args (argparse.Namespace): the result of parsing the command line arguments |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 interface.state.flush_mode = args.ts_mon_flush | 257 interface.state.flush_mode = args.ts_mon_flush |
| 257 interface.state.use_new_proto = args.ts_mon_use_new_proto | 258 interface.state.use_new_proto = args.ts_mon_use_new_proto |
| 258 | 259 |
| 259 if args.ts_mon_flush == 'auto': | 260 if args.ts_mon_flush == 'auto': |
| 260 interface.state.flush_thread = interface._FlushThread( | 261 interface.state.flush_thread = interface._FlushThread( |
| 261 args.ts_mon_flush_interval_secs) | 262 args.ts_mon_flush_interval_secs) |
| 262 interface.state.flush_thread.start() | 263 interface.state.flush_thread.start() |
| 263 | 264 |
| 264 standard_metrics.init() | 265 standard_metrics.init() |
| 265 | 266 |
| OLD | NEW |