InfluxWriter
InfluxWriter batches points and writes them to influxdb.
Constructor Summary
Public Constructor | ||
public |
constructor(options: *) |
Member Summary
Private Members | ||
private |
_batcher: module.Batcher |
|
private |
Influx will overwrite points using the same timestamp and tags. |
|
private |
_influx: InfluxDB |
|
private |
|
Method Summary
Public Methods | ||
public |
writePoint(measurement: String, tags: Object<String, String>, fields: Object<String, *>, time: Date) Add a point to the current batch. |
Private Methods | ||
private |
_flushBatch(batch: *) Flush a batch to InfluxDB. |
Public Constructors
public constructor(options: *) source
Params:
Name | Type | Attribute | Description |
options | * |
Private Members
private _batcher: module.Batcher source
private _counter: number source
Influx will overwrite points using the same timestamp and tags. To work around this we use this _counter field as the nanosecond segment of the timestamp and increment it every time a point is written. This way it is extremely unlikely that any points are overwritten.
private _influx: InfluxDB source
Public Methods
public writePoint(measurement: String, tags: Object<String, String>, fields: Object<String, *>, time: Date) source
Add a point to the current batch. If this batch has exceeded the maximum batch size it will be flushed.
Private Methods
private _flushBatch(batch: *) source
Flush a batch to InfluxDB. This method is triggered by the 'flush' event from Batcher.
Params:
Name | Type | Attribute | Description |
batch | * |