Minimal and smart pusher of samples to InfluxDB for asyncio programs
Project description
Minimal and smart pusher of samples to InfluxDB for asyncio programs
Usage
Create a InfluxDbPusher object
Call it to push samples
InfluxDbPusher will try to do intelligent aggregation of samples in the background to minimise the number of HTTP request to the InfluxDb server.
Example:
import asyncio
import logging
from influxdbpusher import InfluxDbPusher
async def test():
logging.basicConfig(level=logging.DEBUG)
influx = InfluxDbPusher("http://influxdb:8086", "playground")
while True:
for dummy in range(10):
await asyncio.sleep(0.02)
influx("test", dummy, {"foo": "bar"})
influx("measurement1",
{"fieldname1": 'hello "world"', "value": 2.0},
{"foo": "bar"})
await asyncio.sleep(5)
await influx.close()
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(test())
Installation
pip install influxdbpusher
Requirements
Python >= 3.5
aiohttp
Compatibility
Licence
MIT License
Copyright (c) 2017, Gambit Research
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
influxdbpusher-0.1.3.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for influxdbpusher-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76ca5a0dd0a4ee725a5baf0cb0bf69917cb5377c2c61651a20636190faea1749 |
|
MD5 | 58e21dc14d51bc428e75ca2637b64696 |
|
BLAKE2b-256 | 2b40c61aabb82038c65c68f9e5545903b034db4dea4102bfdd7e912b7d5e9916 |