public class InfluxdbHttp extends java.lang.Object implements Influxdb
Influxdb influxdb = new Influxdb(...); influxdb.appendSeries(...); ... influxdb.appendSeries(...); influxdb.sendRequest(); influxdb.appendSeries(...); ... influxdb.appendSeries(...); influxdb.sendRequest();
| Modifier and Type | Field and Description |
|---|---|
boolean |
debugJson
if true then print Json on System.err
|
metrics_influxdb.v08.JsonBuilder |
jsonBuilder |
java.net.URL |
url |
| Constructor and Description |
|---|
InfluxdbHttp(java.lang.String host,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password)
Constructor with the InfluxDB time_precision parameter set to TimeUnit.MILLISECONDS
|
InfluxdbHttp(java.lang.String host,
int port,
java.lang.String path,
java.lang.String database,
java.lang.String username,
java.lang.String password)
Constructor with the InfluxDB time_precision parameter set to TimeUnit.MILLISECONDS
|
InfluxdbHttp(java.lang.String host,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision) |
InfluxdbHttp(java.lang.String scheme,
java.lang.String host,
int port,
java.lang.String path,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision) |
InfluxdbHttp(java.lang.String scheme,
java.lang.String host,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendSeries(java.lang.String namePrefix,
java.lang.String name,
java.lang.String nameSuffix,
java.lang.String[] columns,
java.lang.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 java.lang.String |
toTimePrecision(java.util.concurrent.TimeUnit t) |
public final java.net.URL url
public boolean debugJson
public metrics_influxdb.v08.JsonBuilder jsonBuilder
public InfluxdbHttp(java.lang.String host,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password)
throws java.lang.Exception
java.io.IOException - If the URL is malformedjava.lang.Exceptionpublic InfluxdbHttp(java.lang.String host,
int port,
java.lang.String path,
java.lang.String database,
java.lang.String username,
java.lang.String password)
throws java.lang.Exception
java.io.IOException - If the URL is malformedjava.lang.Exceptionpublic InfluxdbHttp(java.lang.String host,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision)
throws java.lang.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()java.io.IOException - If the URL is malformedjava.lang.Exceptionpublic InfluxdbHttp(java.lang.String scheme,
java.lang.String host,
int port,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision)
throws java.lang.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()java.io.IOException - If the URL is malformedjava.lang.Exceptionpublic InfluxdbHttp(java.lang.String scheme,
java.lang.String host,
int port,
java.lang.String path,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision)
throws java.lang.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()java.io.IOException - If the URL is malformedjava.lang.Exceptionpublic static java.lang.String toTimePrecision(java.util.concurrent.TimeUnit t)
public boolean hasSeriesData()
hasSeriesData in interface Influxdbpublic long convertTimestamp(long timestamp)
convertTimestamp in interface Influxdbpublic void resetRequest()
resetRequest in interface Influxdbpublic void appendSeries(java.lang.String namePrefix,
java.lang.String name,
java.lang.String nameSuffix,
java.lang.String[] columns,
java.lang.Object[][] points)
appendSeries in interface Influxdbpublic int sendRequest(boolean throwExc,
boolean printJson)
throws java.lang.Exception
sendRequest in interface Influxdbjava.lang.Exception