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 |
11 import re | 11 import re |
12 | 12 |
13 import requests | 13 import requests |
14 | 14 |
15 from infra_libs.ts_mon import interface | 15 from infra_libs.ts_mon import interface |
16 from infra_libs.ts_mon import monitors | 16 from infra_libs.ts_mon import monitors |
17 from infra_libs.ts_mon import standard_metrics | 17 from infra_libs.ts_mon.common import standard_metrics |
18 from infra_libs.ts_mon import targets | 18 from infra_libs.ts_mon.common import targets |
19 | 19 |
20 | 20 |
21 def load_machine_config(filename): | 21 def load_machine_config(filename): |
22 if not os.path.exists(filename): | 22 if not os.path.exists(filename): |
23 logging.info('Configuration file does not exist, ignoring: %s', filename) | 23 logging.info('Configuration file does not exist, ignoring: %s', filename) |
24 return {} | 24 return {} |
25 | 25 |
26 try: | 26 try: |
27 with open(filename) as fh: | 27 with open(filename) as fh: |
28 return json.load(fh) | 28 return json.load(fh) |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 args.ts_mon_task_hostname, | 217 args.ts_mon_task_hostname, |
218 args.ts_mon_task_number) | 218 args.ts_mon_task_number) |
219 | 219 |
220 interface.state.flush_mode = args.ts_mon_flush | 220 interface.state.flush_mode = args.ts_mon_flush |
221 | 221 |
222 if args.ts_mon_flush == 'auto': | 222 if args.ts_mon_flush == 'auto': |
223 interface.state.flush_thread = interface._FlushThread( | 223 interface.state.flush_thread = interface._FlushThread( |
224 args.ts_mon_flush_interval_secs) | 224 args.ts_mon_flush_interval_secs) |
225 interface.state.flush_thread.start() | 225 interface.state.flush_thread.start() |
226 | 226 |
| 227 print "ts_mon registering standard metrics" |
227 standard_metrics.init() | 228 standard_metrics.init() |
228 | 229 |
OLD | NEW |