Interface GraphiteSender

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
Graphite, GraphiteRabbitMQ, GraphiteUDP, PickledGraphite

public interface GraphiteSender
extends Closeable
  • Method Summary

    Modifier and Type Method Description
    void connect()
    Connects to the server.
    void flush()
    Flushes buffer, if applicable
    int getFailures()
    Returns the number of failed writes to the server.
    boolean isConnected()
    Returns true if ready to send data
    void send​(String name, String value, long timestamp)
    Sends the given measurement to the server.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • connect

      void connect() throws IllegalStateException, IOException
      Connects to the server.
      Throws:
      IllegalStateException - if the client is already connected
      IOException - if there is an error connecting
    • send

      void send​(String name, String value, long timestamp) throws IOException
      Sends the given measurement to the server.
      Parameters:
      name - the name of the metric
      value - the value of the metric
      timestamp - the timestamp of the metric
      Throws:
      IOException - if there was an error sending the metric
    • flush

      void flush() throws IOException
      Flushes buffer, if applicable
      Throws:
      IOException - if there was an error during flushing metrics to the socket
    • isConnected

      boolean isConnected()
      Returns true if ready to send data
    • getFailures

      int getFailures()
      Returns the number of failed writes to the server.
      Returns:
      the number of failed writes to the server