Package io.dropwizard.metrics5.influxdb
Interface InfluxDbSender
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
InfluxDbUdpSender
public interface InfluxDbSender extends Closeable
-
Method Summary
Modifier and Type Method Description voidconnect()Connects to the server.voiddisconnect()Disconnects from the server.voidflush()Flushes buffer, if applicablebooleanisConnected()Returns true if ready to send datavoidsend(StringBuilder measurement)Sends the given measurement to the server.
-
Method Details
-
connect
Connects to the server.- Throws:
IllegalStateException- if the client is already connectedIOException- if there is an error connecting
-
send
Sends the given measurement to the server.NOTE: The caller may modify the
measurementbuffer after this call. The implementation of this method MUST NOT keep any reference to the buffer after this call.- Parameters:
measurement- a single measurement line, according to the InfluxDb line protocol including a trailing newline.- Throws:
IOException- if there was an error sending the metric
-
flush
Flushes buffer, if applicable- Throws:
IOException- if there was an error during flushing metrics to the server
-
disconnect
Disconnects from the server.- Throws:
IOException- if there is an error disconnecting
-
isConnected
boolean isConnected()Returns true if ready to send data
-