public class InfluxDbHttpSender extends java.lang.Object implements InfluxDbSender
| Constructor and Description |
|---|
InfluxDbHttpSender(java.lang.String hostname,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.lang.String retentionPolicy,
java.util.concurrent.TimeUnit timePrecision)
Creates a new http sender given connection details.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendPoints(InfluxDbPoint point)
Adds this metric point to the buffer.
|
void |
flush()
Flushes buffer, if applicable.
|
boolean |
hasSeriesData() |
void |
setTags(java.util.Map<java.lang.String,java.lang.String> tags)
Set tags applicable for all the points.
|
void |
writeData()
Writes buffer data to InfluxDb.
|
public InfluxDbHttpSender(java.lang.String hostname,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.lang.String retentionPolicy,
java.util.concurrent.TimeUnit timePrecision)
throws java.lang.Exception
hostname - the influxDb hostnameport - the influxDb http portdatabase - the influxDb database to write tousername - the influxDb usernamepassword - the influxDb passwordretentionPolicy - Retention policy to usetimePrecision - the time precision of the metricsjava.lang.Exception - exception while creating the influxDb sender(MalformedURLException)public void flush()
InfluxDbSenderflush in interface InfluxDbSenderpublic boolean hasSeriesData()
hasSeriesData in interface InfluxDbSenderpublic void appendPoints(InfluxDbPoint point)
InfluxDbSenderappendPoints in interface InfluxDbSenderpoint - metric point with tags and fieldspublic void setTags(java.util.Map<java.lang.String,java.lang.String> tags)
InfluxDbSendersetTags in interface InfluxDbSendertags - map containing tags common to all metricspublic void writeData()
throws java.lang.Exception
InfluxDbSenderwriteData in interface InfluxDbSenderjava.lang.Exception - exception while writing to InfluxDb api