Skip to content

Sahanduiuc/influxdb-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

influxdb-java

A pure Java library to access the REST API of a InfluxDB database.

This implementation is meant as a Java rewrite of the influxdb-go package. All low level REST Api calls are available.

Typical usage looks like:

InfluxDB influxDB = InfluxDBFactory.connect("http://172.17.0.2:8086", "root", "root");

this.influxDB.createDatabase("aTimeSeries", 1);

Serie serie = new Serie.Builder("serieName")
			.columns("column1", "column2")
			.values(System.currentTimeMillis(), 1)
			.values(System.currentTimeMillis(), 2)
			.build();
Serie[] series = new Serie[] { serie };
this.influxDB.write(dbName, series, TimeUnit.MILLISECONDS);

For additional usage examples have a look ad InfluxDBTest.java

Build Requirements

  • Java 1.6+
  • Maven 3.0+
  • Docker daemon running

Maven will run tests during build process using a docker image with influxdb actual image is majst01/influxdb-java. This docker image is pulled during the first test run which will take some time. So the first test execution will fail because the image to pull is not there. You can check with:

    $ docker images | grep majst01
majst01/influxdb-java      latest              50256afac0c9        About an hour ago   298.7 MB

Then you can build influxdb-java with all tests with:

$ mvn clean install

If you don't have Docker running locally, you can skip tests with -DskipTests flag set to true:

$ mvn clean install -DskipTests=true

TODO

Publish to maven-repo.

About

Java client for InfluxDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.3%
  • Shell 0.7%