Package com.izettle.metrics.influxdb
Class InfluxDBKafkaSender
- java.lang.Object
-
- com.izettle.metrics.influxdb.InfluxDBKafkaSender
-
- All Implemented Interfaces:
InfluxDbSender
public class InfluxDBKafkaSender extends Object
-
-
Constructor Summary
Constructors Constructor Description InfluxDBKafkaSender(String database, TimeUnit timePrecision, String measurementPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendPoints(InfluxDbPoint point)Adds this metric point to the buffer.voidflush()Flushes buffer, if applicable.protected InfluxDbWriteObjectSerializergetSerializer()Map<String,String>getTags()protected InfluxDbWriteObjectgetWriteObject()booleanhasSeriesData()voidsetTags(Map<String,String> tags)Set tags applicable for all the points.intwriteData()Writes buffer data to InfluxDb.protected intwriteData(byte[] line)
-
-
-
Method Detail
-
flush
public void flush()
Description copied from interface:InfluxDbSenderFlushes buffer, if applicable.- Specified by:
flushin interfaceInfluxDbSender
-
hasSeriesData
public boolean hasSeriesData()
- Specified by:
hasSeriesDatain interfaceInfluxDbSender- Returns:
- true if there is data available to send.
-
appendPoints
public void appendPoints(InfluxDbPoint point)
Description copied from interface:InfluxDbSenderAdds this metric point to the buffer.- Specified by:
appendPointsin interfaceInfluxDbSender- Parameters:
point- metric point with tags and fields
-
writeData
public int writeData() throws ExceptionDescription copied from interface:InfluxDbSenderWrites buffer data to InfluxDb.- Specified by:
writeDatain interfaceInfluxDbSender- Returns:
- the response code for the request sent to InfluxDb.
- Throws:
Exception- exception while writing to InfluxDb api
-
setTags
public void setTags(Map<String,String> tags)
Description copied from interface:InfluxDbSenderSet tags applicable for all the points.- Specified by:
setTagsin interfaceInfluxDbSender- Parameters:
tags- map containing tags common to all metrics
-
getTags
public Map<String,String> getTags()
- Specified by:
getTagsin interfaceInfluxDbSender
-
getWriteObject
protected InfluxDbWriteObject getWriteObject()
-
getSerializer
protected InfluxDbWriteObjectSerializer getSerializer()
-
-