Class OpenTsdbSocketInserter
- java.lang.Object
-
- com.elastisys.autoscaler.systemhistorians.opentsdb.OpenTsdbSocketInserter
-
- All Implemented Interfaces:
OpenTsdbInserter
public class OpenTsdbSocketInserter extends java.lang.Object implements OpenTsdbInserter
AnOpenTsdbInserterthat uses OpenTSDB's simplistic telnet-style protocol to insert values. The operation of theOpenTsdbSocketInserteris 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 voidinsert(MetricValue value)Inserts a singleMetricValueinto a backing OpenTSDB server.
-
-
-
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- TheLoggerinstance to make use of.host- The hostname or IP address to connect to.port- The port number to connect to.
-
-
Method Detail
-
insert
public void insert(MetricValue value) throws OpenTsdbException
Description copied from interface:OpenTsdbInserterInserts a singleMetricValueinto a backing OpenTSDB server.- Specified by:
insertin interfaceOpenTsdbInserter- Parameters:
value- The data point to be inserted.- Throws:
OpenTsdbException- Thrown if the insert operation fails.
-
-