Allow default statsd values

Show the defaults in the debug log if nothing is specified
This commit is contained in:
Ian Wienand 2018-06-05 11:05:00 +10:00
parent 26a7a2c827
commit 2bb567c24e

View File

@ -49,8 +49,10 @@ class AFSMonCmd(object):
statsd_args['host'] = os.environ['STATSD_HOST']
if os.getenv('STATSD_PORT', None):
statsd_args['port'] = os.environ['STATSD_PORT']
logger.debug("Sending stats to %s:%s" % (statsd_args['host'],
statsd_args['port']))
logger.debug("Sending stats to %s:%s" % (
statsd_args.get('host', 'localhost'),
statsd_args.get('port', '8125'))
)
self.statsd = statsd.StatsClient(**statsd_args)
# With a lot of volumes, we can flood out a lot of stats