Class OpenTsdbSocketInserter

  • All Implemented Interfaces:
    OpenTsdbInserter

    public class OpenTsdbSocketInserter
    extends java.lang.Object
    implements OpenTsdbInserter
    An OpenTsdbInserter that uses OpenTSDB's simplistic telnet-style protocol to insert values.

    The operation of the OpenTsdbSocketInserter is equivalent to inserting values over the telnet-style protocol via a command such as the following:

       echo "put my.metric `date +%s` 1.0 tag1=value1" | nc 1.2.3.4 4242
     
    In the current version of the protocol, the OpenTSDB server only replies if an error occurs.
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenTsdbSocketInserter​(org.slf4j.Logger logger, java.lang.String host, int port)
      Creates a new instance that will stream values (using the telnet-style protocol) to a OpenTSDB server listening on a given host and port.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void insert​(MetricValue value)
      Inserts a single MetricValue into a backing OpenTSDB server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpenTsdbSocketInserter

        public OpenTsdbSocketInserter​(org.slf4j.Logger logger,
                                      java.lang.String host,
                                      int port)
        Creates a new instance that will stream values (using the telnet-style protocol) to a OpenTSDB server listening on a given host and port.
        Parameters:
        logger - The Logger instance to make use of.
        host - The hostname or IP address to connect to.
        port - The port number to connect to.