InfluxDB
Connection
- class InfluxDBConnection(app, id=None, config=None)[source]
Bases:
ConnectionDescription: InfluxDBConnection serves to connect BSPump application with an InfluxDB database. The InfluxDB server is accessed via URL, and the database is specified using the db parameter in the configuration.
app = bspump.BSPumpApplication() svc = app.get_service("bspump.PumpService") svc.add_connection( bspump.influxdb.InfluxDBConnection(app, "InfluxConnection1") ) **Config Default** url : http://localhost:8086/ db : mydb output_queue_max_size : 10 output_bucket_max_size : 1000 * 1000 timout : 30 retry_enabled : False response_codes_to_retry : 404, 502, 503, 504
Sink
- class InfluxDBSink(app, pipeline, connection, id=None, config=None)[source]
Bases:
SinkDescription: InfluxDBSink is a sink processor, that stores the event into an InfluxDB database specified in the InfluxDBConnection object.
class SamplePipeline(bspump.Pipeline): def __init__(self, app, pipeline_id): super().__init__(app, pipeline_id) self.build( bspump.socket.TCPStreamSource(app, self, config={'port': 7000}), bspump.influxdb.InfluxDBSink(app, self, "InfluxConnection1") )