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

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

Issue 2705273003: Roll infra_libs and gae_ts_mon in luci-py, and add field_specs to all metrics (Closed)
Patch Set: Rebase Created 3 years, 9 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
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 if endpoint.startswith('file://'): 237 if endpoint.startswith('file://'):
238 interface.state.global_monitor = monitors.DebugMonitor( 238 interface.state.global_monitor = monitors.DebugMonitor(
239 endpoint[len('file://'):]) 239 endpoint[len('file://'):])
240 elif endpoint.startswith('pubsub://'): 240 elif endpoint.startswith('pubsub://'):
241 if credentials: 241 if credentials:
242 url = urlparse.urlparse(endpoint) 242 url = urlparse.urlparse(endpoint)
243 project = url.netloc 243 project = url.netloc
244 topic = url.path.strip('/') 244 topic = url.path.strip('/')
245 interface.state.global_monitor = monitors.PubSubMonitor( 245 interface.state.global_monitor = monitors.PubSubMonitor(
246 credentials, project, topic, use_instrumented_http=True, 246 monitors.CredentialFactory.from_string(credentials), project, topic,
247 ca_certs=args.ts_mon_ca_certs) 247 use_instrumented_http=True, ca_certs=args.ts_mon_ca_certs)
248 else: 248 else:
249 logging.error('ts_mon monitoring is disabled because credentials are not ' 249 logging.error('ts_mon monitoring is disabled because credentials are not '
250 'available') 250 'available')
251 elif endpoint.startswith('https://'): 251 elif endpoint.startswith('https://'):
252 interface.state.global_monitor = monitors.HttpsMonitor( 252 interface.state.global_monitor = monitors.HttpsMonitor(
253 endpoint, credentials, ca_certs=args.ts_mon_ca_certs) 253 endpoint, monitors.CredentialFactory.from_string(credentials),
254 ca_certs=args.ts_mon_ca_certs)
254 elif endpoint.lower() == 'none': 255 elif endpoint.lower() == 'none':
255 logging.info('ts_mon monitoring has been explicitly disabled') 256 logging.info('ts_mon monitoring has been explicitly disabled')
256 else: 257 else:
257 logging.error('ts_mon monitoring is disabled because the endpoint provided' 258 logging.error('ts_mon monitoring is disabled because the endpoint provided'
258 ' is invalid or not supported: %s', endpoint) 259 ' is invalid or not supported: %s', endpoint)
259 260
260 interface.state.flush_mode = args.ts_mon_flush 261 interface.state.flush_mode = args.ts_mon_flush
261 interface.state.use_new_proto = use_new_proto 262 interface.state.use_new_proto = use_new_proto
262 263
263 if args.ts_mon_flush == 'auto': 264 if args.ts_mon_flush == 'auto':
264 interface.state.flush_thread = interface._FlushThread( 265 interface.state.flush_thread = interface._FlushThread(
265 args.ts_mon_flush_interval_secs) 266 args.ts_mon_flush_interval_secs)
266 interface.state.flush_thread.start() 267 interface.state.flush_thread.start()
267 268
268 standard_metrics.init() 269 standard_metrics.init()
269 270
OLDNEW
« no previous file with comments | « client/third_party/infra_libs/ts_mon/common/standard_metrics.py ('k') | client/third_party/infra_libs/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698