public class InfluxdbHttp extends Object
Influxdb influxdb = new Influxdb(...); influxdb.appendSeries(...); ... influxdb.appendSeries(...); influxdb.sendRequest(); influxdb.appendSeries(...); ... influxdb.appendSeries(...); influxdb.sendRequest();
| Modifier and Type | Field and Description |
|---|---|
boolean |
debugJson
true => to print Json on System.err
|
metrics_influxdb.JsonBuilder |
jsonBuilder |
URL |
url |
| Constructor and Description |
|---|
InfluxdbHttp(String host,
int port,
String database,
String username,
String password)
Constructor with the InfluxDB time_precision parameter set to TimeUnit.MILLISECONDS
|
InfluxdbHttp(String host,
int port,
String path,
String database,
String username,
String password)
Constructor with the InfluxDB time_precision parameter set to TimeUnit.MILLISECONDS
|
InfluxdbHttp(String host,
int port,
String path,
String database,
String username,
String password,
TimeUnit timePrecision) |
InfluxdbHttp(String host,
int port,
String database,
String username,
String password,
TimeUnit timePrecision) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendSeries(String namePrefix,
String name,
String nameSuffix,
String[] columns,
Object[][] points) |
long |
convertTimestamp(long timestamp) |
boolean |
hasSeriesData()
Returns true if the pending request has metrics to report.
|
void |
resetRequest()
Forgot previously appendSeries.
|
int |
sendRequest(boolean throwExc,
boolean printJson) |
static String |
toTimePrecision(TimeUnit t) |
public final URL url
public boolean debugJson
public metrics_influxdb.JsonBuilder jsonBuilder
public InfluxdbHttp(String host, int port, String database, String username, String password) throws Exception
IOException - If the URL is malformedExceptionpublic InfluxdbHttp(String host, int port, String path, String database, String username, String password) throws Exception
IOException - If the URL is malformedExceptionpublic InfluxdbHttp(String host, int port, String database, String username, String password, TimeUnit timePrecision) throws Exception
timePrecision - The precision of the epoch time that is sent to the server,
should be TimeUnit.MILLISECONDS unless you are using a custom Clock
that does not return milliseconds epoch time for getTime()IOException - If the URL is malformedExceptionpublic InfluxdbHttp(String host, int port, String path, String database, String username, String password, TimeUnit timePrecision) throws Exception
timePrecision - The precision of the epoch time that is sent to the server,
should be TimeUnit.MILLISECONDS unless you are using a custom Clock
that does not return milliseconds epoch time for getTime()IOException - If the URL is malformedExceptionpublic boolean hasSeriesData()
public long convertTimestamp(long timestamp)
public void resetRequest()
public void appendSeries(String namePrefix, String name, String nameSuffix, String[] columns, Object[][] points)
Copyright © 2014-2015. All Rights Reserved.