The library provide :
- a lighter client than influxdb-java to push only series to an InfluxDB server.
- A reporter for metrics which announces measurements.
The library provide a lighter client than influxdb-java to push only metrics.
- slf4j-api for logging.
- metrics-core, to provide, if you use InfluxdbReporter.
private static InfluxdbReporter startInfluxdbReporter(MetricRegistry registry) throws Exception {
final InfluxdbHttp influxdb = new InfluxdbHttp("127.0.0.1", 8086, "mydb", "user", "pass"); // http transport
// = new InfluxDbUdp("127.0.0.1", 1234); // udp transport
//influxdb.debugJson = true; // to print json on System.err
//influxdb.jsonBuilder = new MyJsonBuildler(); // to use MyJsonBuilder to create json
final InfluxdbReporter reporter = InfluxdbReporter
.forRegistry(registry)
.prefixedWith("test")
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.MILLISECONDS)
.filter(MetricFilter.ALL)
.skipIdleMetrics(true) // Only report metrics that have changed.
.build(influxdb);
reporter.start(10, TimeUnit.SECONDS);
return reporter;
}
To the extent possible under law,
Novaquark
has waived all copyright and related or neighboring rights to
this work.