Java Client for RedisTimeSeries
<dependencies>
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jredistimeseries</artifactId>
<version>0.10.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
and
<dependencies>
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>jredistimeseries</artifactId>
<version>0.11.0-SNAPSHOT</version>
</dependency>
</dependencies>
RedisTimeSeries rts = new RedisTimeSeries("localhost", 6379);
Map<String, String> labels = new HashMap<>();
labels.put("country", "US");
labels.put("cores", "8");
rts.create("cpu1", 60*10 /*10min*/, 100, labels);
rts.create("cpu1-avg", 60*10 /*10min*/, 100, null);
rts.createRule("cpu1", Aggregation.AVG, 60 /*1min*/, "cpu1-avg");
rts.add("cpu1", System.currentTimeMillis()/1000 /* time sec */, 80);
// Get all the timeseries in US in the last 10min average per min
rts.mrange(System.currentTimeMillis()/1000 - 10*60, System.currentTimeMillis()/1000, Aggregation.AVG, 60, "country=US")