Improve the InfluxDB through-put performance
This changes the current use of the InfluxDB client to instead use a baked-in client that uses the fasthttp library. This allows for significantly smaller allocations, the re-use of http body buffers, and the re-use of the actual bytes of the line-protocol metric representations.
This commit is contained in:
22
plugins/outputs/influxdb/client/client.go
Normal file
22
plugins/outputs/influxdb/client/client.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package client
|
||||
|
||||
import "io"
|
||||
|
||||
type Client interface {
|
||||
Query(command string) error
|
||||
|
||||
Write(b []byte) (int, error)
|
||||
WriteWithParams(b []byte, params WriteParams) (int, error)
|
||||
|
||||
WriteStream(b io.Reader, contentLength int) (int, error)
|
||||
WriteStreamWithParams(b io.Reader, contentLength int, params WriteParams) (int, error)
|
||||
|
||||
Close() error
|
||||
}
|
||||
|
||||
type WriteParams struct {
|
||||
Database string
|
||||
RetentionPolicy string
|
||||
Precision string
|
||||
Consistency string
|
||||
}
|
||||
Reference in New Issue
Block a user