public class InfluxdbHttp
extends java.lang.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
if true then print Json on System.err
|
metrics_influxdb.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 path,
java.lang.String database,
java.lang.String username,
java.lang.String password,
java.util.concurrent.TimeUnit timePrecision) |
InfluxdbHttp(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.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 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()
public long convertTimestamp(long timestamp)
public void resetRequest()
public void appendSeries(java.lang.String namePrefix,
java.lang.String name,
java.lang.String nameSuffix,
java.lang.String[] columns,
java.lang.Object[][] points)
public int sendRequest(boolean throwExc,
boolean printJson)
throws java.lang.Exception
java.lang.Exception