Skip to content
Java Client for RedisTimeSeries
Branch: master
Clone or download
Latest commit 4cd3a41 Mar 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci add workflows Mar 3, 2019
src
.circleci.settings.xml Add mvn settings Jan 25, 2019
.gitignore add target to ignore Jan 25, 2019
LICENSE
README.md
pom.xml

README.md

license CircleCI GitHub issues Maven Central Javadocs Codecov

JRedisTimeSeries

Java Client for RedisTimeSeries

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jredistimeseries</artifactId>
      <version>0.6.0</version>
    </dependency>
  </dependencies>

Snapshots

  <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.7.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

Example: Using the Java Client

   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")
You can’t perform that action at this time.