public class InfluxDbHttpSender extends Object implements InfluxDbSender
| Constructor and Description |
|---|
InfluxDbHttpSender(String protocol,
String hostname,
int port,
String database,
String username,
String password)
Creates a new http sender given connection details.
|
InfluxDbHttpSender(String protocol,
String hostname,
int port,
String database,
String username,
String password,
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(Map<String,String> tags)
Set tags applicable for all the points.
|
int |
writeData()
Writes buffer data to InfluxDb.
|
public InfluxDbHttpSender(String protocol, String hostname, int port, String database, String username, String password) throws Exception
protocol - the influxDb protocolhostname - the influxDb hostnameport - the influxDb http portdatabase - the influxDb database to write tousername - the username used to connect to influxDbpassword - the password used to connect to influxDbException - exception while creating the influxDb sender(MalformedURLException)public InfluxDbHttpSender(String protocol, String hostname, int port, String database, String username, String password, TimeUnit timePrecision) throws Exception
protocol - the influxDb protocolhostname - the influxDb hostnameport - the influxDb http portdatabase - the influxDb database to write tousername - the influxDb usernamepassword - the influxDb passwordtimePrecision - the time precision of the metricsException - 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 int writeData()
throws Exception
InfluxDbSenderwriteData in interface InfluxDbSenderException - exception while writing to InfluxDb apipublic void setTags(Map<String,String> tags)
InfluxDbSendersetTags in interface InfluxDbSendertags - map containing tags common to all metricsCopyright © 2021. All rights reserved.