mirror of
https://github.com/sprockets/sprockets.mixins.metrics.git
synced 2024-11-21 19:28:34 +00:00
Update README
This commit is contained in:
parent
bf59e1f174
commit
9835e4b04e
1 changed files with 11 additions and 10 deletions
21
README.rst
21
README.rst
|
@ -22,17 +22,15 @@ call to the ``get`` method as well as a separate metric for the database query.
|
|||
import queries
|
||||
|
||||
def make_application():
|
||||
settings = {
|
||||
statsd.SETTINGS_KEY: {
|
||||
'namespace': 'my-application',
|
||||
'host': os.environ.get('STATSD_HOST', '127.0.0.1'),
|
||||
'port': os.environ.get('STATSD_PORT', '8125'),
|
||||
}
|
||||
}
|
||||
return web.Application([
|
||||
# insert handlers here
|
||||
application = web.Application([
|
||||
web.url(r'/', MyHandler),
|
||||
], **settings)
|
||||
|
||||
statsd.install({'namespace': 'my-application',
|
||||
'host': os.environ.get('STATSD_HOST', '127.0.0.1'),
|
||||
'port': os.environ.get('STATSD_PORT', '8125')})
|
||||
return application
|
||||
|
||||
class MyHandler(statsd.StatsdMixin,
|
||||
mediatype.ContentMixin,
|
||||
web.RequestHandler):
|
||||
|
@ -54,6 +52,9 @@ Settings
|
|||
:namespace: The namespace for the measurements
|
||||
:host: The Statsd host
|
||||
:port: The Statsd port
|
||||
:prepend_metric_type: Optional flag to prepend bucket path with the StatsD
|
||||
metric type
|
||||
:prepend_hostname: Optional flag to prepend bucket path with the hostname
|
||||
|
||||
InfluxDB Mixin
|
||||
--------------
|
||||
|
@ -76,7 +77,7 @@ variables:
|
|||
|
||||
application = web.Application(
|
||||
[
|
||||
web.url(r'/', RequestHandler),
|
||||
web.url(r'/', MyHandler),
|
||||
], **settings)
|
||||
|
||||
influxdb.install({'url': 'http://localhost:8086',
|
||||
|
|
Loading…
Reference in a new issue