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

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

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: clean up code Created 5 years, 4 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
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 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 from infra_libs.ts_mon import interface
14 from infra_libs.ts_mon import monitors 13 from infra_libs.ts_mon import monitors
15 from infra_libs.ts_mon import standard_metrics 14 from infra_libs.ts_mon.gae import interface
16 from infra_libs.ts_mon import targets 15 from infra_libs.ts_mon.gae import standard_metrics
16 from infra_libs.ts_mon.gae import targets
17 17
18 18
19 def load_machine_config(filename): 19 def load_machine_config(filename):
20 if not os.path.exists(filename): 20 if not os.path.exists(filename):
21 logging.info('Configuration file does not exist, ignoring: %s', filename) 21 logging.info('Configuration file does not exist, ignoring: %s', filename)
22 return {} 22 return {}
23 23
24 try: 24 try:
25 with open(filename) as fh: 25 with open(filename) as fh:
26 return json.load(fh) 26 return json.load(fh)
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 interface.state.flush_mode = args.ts_mon_flush 194 interface.state.flush_mode = args.ts_mon_flush
195 195
196 if args.ts_mon_flush == 'auto': 196 if args.ts_mon_flush == 'auto':
197 interface.state.flush_thread = interface._FlushThread( 197 interface.state.flush_thread = interface._FlushThread(
198 args.ts_mon_flush_interval_secs) 198 args.ts_mon_flush_interval_secs)
199 interface.state.flush_thread.start() 199 interface.state.flush_thread.start()
200 200
201 standard_metrics.init() 201 standard_metrics.init()
202 202
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698