Package io.dropwizard.metrics5.influxdb
Interface InfluxDbSender
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
InfluxDbUdpSender
public interface InfluxDbSender extends Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods 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 Detail
-
connect
void connect() throws IllegalStateException, IOExceptionConnects to the server.- Throws:
IllegalStateException- if the client is already connectedIOException- if there is an error connecting
-
send
void send(StringBuilder measurement) throws IOException
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
void flush() throws IOExceptionFlushes buffer, if applicable- Throws:
IOException- if there was an error during flushing metrics to the server
-
disconnect
void disconnect() throws IOExceptionDisconnects from the server.- Throws:
IOException- if there is an error disconnecting
-
isConnected
boolean isConnected()
Returns true if ready to send data
-
-