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

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

Issue 2708113002: Revert of Add field_specs to all metrics in luci-py (Closed)
Patch Set: Created 3 years, 10 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 monitors.CredentialFactory.from_string(credentials), project, topic, 246 credentials, project, topic, use_instrumented_http=True,
247 use_instrumented_http=True, ca_certs=args.ts_mon_ca_certs) 247 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, monitors.CredentialFactory.from_string(credentials), 253 endpoint, credentials, ca_certs=args.ts_mon_ca_certs)
254 ca_certs=args.ts_mon_ca_certs)
255 elif endpoint.lower() == 'none': 254 elif endpoint.lower() == 'none':
256 logging.info('ts_mon monitoring has been explicitly disabled') 255 logging.info('ts_mon monitoring has been explicitly disabled')
257 else: 256 else:
258 logging.error('ts_mon monitoring is disabled because the endpoint provided' 257 logging.error('ts_mon monitoring is disabled because the endpoint provided'
259 ' is invalid or not supported: %s', endpoint) 258 ' is invalid or not supported: %s', endpoint)
260 259
261 interface.state.flush_mode = args.ts_mon_flush 260 interface.state.flush_mode = args.ts_mon_flush
262 interface.state.use_new_proto = use_new_proto 261 interface.state.use_new_proto = use_new_proto
263 262
264 if args.ts_mon_flush == 'auto': 263 if args.ts_mon_flush == 'auto':
265 interface.state.flush_thread = interface._FlushThread( 264 interface.state.flush_thread = interface._FlushThread(
266 args.ts_mon_flush_interval_secs) 265 args.ts_mon_flush_interval_secs)
267 interface.state.flush_thread.start() 266 interface.state.flush_thread.start()
268 267
269 standard_metrics.init() 268 standard_metrics.init()
270 269
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