mirror of
https://github.com/sprockets/sprockets.mixins.metrics.git
synced 2024-11-28 11:19:54 +00:00
Bump version -> 1.1.0
Add setting options to README
This commit is contained in:
parent
e8dea1517a
commit
ca7ed9c846
4 changed files with 55 additions and 8 deletions
49
README.rst
49
README.rst
|
@ -28,8 +28,13 @@ from using `statsd`_ to `InfluxDB`_ is simply a matter of switch from the
|
||||||
``metrics.StatsdMixin`` to the ``metrics.InfluxDBMixin``.
|
``metrics.StatsdMixin`` to the ``metrics.InfluxDBMixin``.
|
||||||
|
|
||||||
The mix-in is configured through the ``tornado.web.Application`` settings
|
The mix-in is configured through the ``tornado.web.Application`` settings
|
||||||
property using a key defined by the specific mix-in. The following snippet
|
property using a key defined by the specific mix-in.
|
||||||
configures the StatsD mix-in from common environment variables:
|
|
||||||
|
Statsd Mixin
|
||||||
|
------------
|
||||||
|
|
||||||
|
The following snippet configures the StatsD mix-in from common environment
|
||||||
|
variables:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -50,6 +55,46 @@ configures the StatsD mix-in from common environment variables:
|
||||||
# insert handlers here
|
# insert handlers here
|
||||||
], **settings)
|
], **settings)
|
||||||
|
|
||||||
|
:namespace: The namespace for the measurements
|
||||||
|
:host: The Statsd host
|
||||||
|
:port: The Statsd port
|
||||||
|
|
||||||
|
InfluxDB Mixin
|
||||||
|
--------------
|
||||||
|
|
||||||
|
The following snippet configures the InfluxDB mix-in from common environment
|
||||||
|
variables:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from sprockets.mixins import metrics
|
||||||
|
from tornado import web
|
||||||
|
|
||||||
|
def make_application():
|
||||||
|
settings = {
|
||||||
|
metrics.InfluxDBMixin.SETTINGS_KEY: {
|
||||||
|
'measurement': 'my-application',
|
||||||
|
'database': 'services',
|
||||||
|
'write_url': 'http://{}:{}/write'.format(
|
||||||
|
os.environ.get('INFLUX_HOST', '127.0.0.1'),
|
||||||
|
os.environ.get('INFLUX_PORT', 8086)),
|
||||||
|
'max_buffer_time': 3,
|
||||||
|
'max_buffer_length': 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return web.Application([
|
||||||
|
# insert handlers here
|
||||||
|
], **settings)
|
||||||
|
|
||||||
|
:measurement: The InfluxDB measurement name
|
||||||
|
:database: The InfluxDB database to write measurements into
|
||||||
|
:write_url: the InfluxDB write URL to send HTTP requests to
|
||||||
|
:max_buffer_time: The maximum elasped time measurements should remain in
|
||||||
|
buffer before writing to InfluxDB.
|
||||||
|
:max_buffer_length: The maximum number of measurements to
|
||||||
|
buffer before writing to InfluxDB.
|
||||||
|
|
||||||
Development Quickstart
|
Development Quickstart
|
||||||
----------------------
|
----------------------
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
Release History
|
Release History
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
`1.1.0`_ (9-Mar-2016)
|
||||||
|
---------------------
|
||||||
|
- Update InfluxDB mixin to buffer measurements across requests based on a max time and/or length.
|
||||||
|
|
||||||
`1.0.1`_ (1-Feb-2016)
|
`1.0.1`_ (1-Feb-2016)
|
||||||
---------------------
|
---------------------
|
||||||
- Fix packaging woes.
|
- Fix packaging woes.
|
||||||
|
@ -20,7 +24,8 @@ Release History
|
||||||
- Add :class:`sprockets.mixins.metrics.InfluxDBMixin`
|
- Add :class:`sprockets.mixins.metrics.InfluxDBMixin`
|
||||||
- Add :class:`sprockets.mixins.metrics.influxdb.InfluxDBConnection`
|
- Add :class:`sprockets.mixins.metrics.influxdb.InfluxDBConnection`
|
||||||
|
|
||||||
.. _Next Release: https://github.com/sprockets/sprockets.mixins.metrics/compare/1.0.1...master
|
.. _Next Release: https://github.com/sprockets/sprockets.mixins.metrics/compare/1.1.0...master
|
||||||
.. _1.0.0: https://github.com/sprockets/sprockets.mixins.metrics/compare/1.0.0...1.0.0
|
.. _1.1.0: https://github.com/sprockets/sprockets.mixins.metrics/compare/1.0.1...1.1.0
|
||||||
|
.. _1.0.1: https://github.com/sprockets/sprockets.mixins.metrics/compare/1.0.0...1.0.1
|
||||||
.. _1.0.0: https://github.com/sprockets/sprockets.mixins.metrics/compare/0.9.0...1.0.0
|
.. _1.0.0: https://github.com/sprockets/sprockets.mixins.metrics/compare/0.9.0...1.0.0
|
||||||
.. _0.9.0: https://github.com/sprockets/sprockets.mixins.metrics/compare/0.0.0...0.9.0
|
.. _0.9.0: https://github.com/sprockets/sprockets.mixins.metrics/compare/0.0.0...0.9.0
|
||||||
|
|
|
@ -8,6 +8,6 @@ except ImportError as error:
|
||||||
def StatsdMixin(*args, **kwargs):
|
def StatsdMixin(*args, **kwargs):
|
||||||
raise error
|
raise error
|
||||||
|
|
||||||
version_info = (1, 0, 1)
|
version_info = (1, 1, 0)
|
||||||
__version__ = '.'.join(str(v) for v in version_info)
|
__version__ = '.'.join(str(v) for v in version_info)
|
||||||
__all__ = ['__version__', 'version_info', 'InfluxDBMixin', 'StatsdMixin']
|
__all__ = ['__version__', 'version_info', 'InfluxDBMixin', 'StatsdMixin']
|
||||||
|
|
|
@ -26,9 +26,6 @@ class InfluxDBConnection(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
MAX_BUFFER_TIME = 5
|
|
||||||
MAX_BUFFER_LENGTH = 100
|
|
||||||
|
|
||||||
def __init__(self, write_url, database, io_loop=None,
|
def __init__(self, write_url, database, io_loop=None,
|
||||||
max_buffer_time=5, max_buffer_length=100):
|
max_buffer_time=5, max_buffer_length=100):
|
||||||
self.io_loop = ioloop.IOLoop.instance() if io_loop is None else io_loop
|
self.io_loop = ioloop.IOLoop.instance() if io_loop is None else io_loop
|
||||||
|
|
Loading…
Reference in a new issue