Pass the IOLoop into the HTTPClient

This commit is contained in:
Gavin M. Roy 2016-03-10 17:15:35 -05:00
parent 167fe7af46
commit 9ac286bf65

View file

@ -127,7 +127,6 @@ class InfluxDBCollector(object):
io_loop=None, submission_interval=SUBMISSION_INTERVAL,
max_batch_size=MAX_BATCH_SIZE, tags=None):
self._buffer = list()
self._client = httpclient.AsyncHTTPClient(force_instance=True)
self._client.configure(None, defaults={'user_agent': _USER_AGENT})
self._database = database
self._influxdb_url = '{}?db={}'.format(url, database)
@ -137,6 +136,9 @@ class InfluxDBCollector(object):
self._pending = 0
self._tags = tags or {}
self._client = httpclient.AsyncHTTPClient(force_instance=True,
io_loop=self._io_loop)
# Add the periodic callback for submitting metrics
LOGGER.info('Starting PeriodicCallback for writing InfluxDB metrics')
self._callback = ioloop.PeriodicCallback(self._write_metrics,