def get_app(self): self.application = web.Application([ web.url(r'/', examples.influxdb.SimpleHandler), web.url(r'/write', FakeInfluxHandler), ]) influxdb.install(self.application, **{'database': 'requests', 'submission_interval': 1, 'url': self.get_url('/write')}) self.application.influx_db = {} return self.application
def get_app(self): self.application = web.Application([ web.url(r'/', examples.influxdb.SimpleHandler), web.url(r'/write', FakeInfluxHandler), ]) influxdb.install( self.application, **{ 'database': 'requests', 'submission_interval': 1, 'url': self.get_url('/write') }) self.application.influx_db = {} return self.application
def make_application(): """ Create a application configured to send metrics. Measurements will be sent to the ``testing`` database on the configured InfluxDB instance. The measurement name is set by the ``service`` setting. """ settings = { influxdb.SETTINGS_KEY: { 'measurement': 'example', } } application = web.Application([web.url('/', SimpleHandler)], **settings) influxdb.install(application, **{'database': 'testing'}) return application