
io.dropwizard.metrics5.influxdb.InfluxDbSender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-influxdb Show documentation
Show all versions of metrics-influxdb Show documentation
A reporter for Metrics which announces measurements to an InfluxDB server.
package io.dropwizard.metrics5.influxdb;
import java.io.Closeable;
import java.io.IOException;
public interface InfluxDbSender extends Closeable {
/**
* Connects to the server.
*
* @throws IllegalStateException if the client is already connected
* @throws IOException if there is an error connecting
*/
void connect() throws IllegalStateException, IOException;
/**
* Sends the given measurement to the server.
*
* NOTE: The caller may modify the measurement
buffer after this call.
* The implementation of this method MUST NOT keep any reference to the buffer after this call.
*
*
* @param 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
*/
void send(StringBuilder measurement) throws IOException;
/**
* Flushes buffer, if applicable
*
* @throws IOException if there was an error during flushing metrics to the server
*/
void flush() throws IOException;
/**
* Disconnects from the server.
*
* @throws IOException if there is an error disconnecting
*/
void disconnect() throws IOException;
/**
* Returns true if ready to send data
*/
boolean isConnected();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy