Skip to content

RedisTimeSeries/JRedisTimeSeries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license GitHub issues Maven Central Javadocs Codecov Language grade: Java Known Vulnerabilities

JRedisTimeSeries

Forum Discord

Java Client for RedisTimeSeries

Deprecation notice

As of Jedis 4.2.0, this library is deprecated. Its features have been merged into Jedis. Please install it either from maven or the repo.

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jredistimeseries</artifactId>
      <version>1.4.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>1.5.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*/, labels);

   rts.create("cpu1-avg", 60*10 /*10min*/, null);
   rts.createRule("cpu1", Aggregation.AVG, 60 /*1min*/, "cpu1-avg");

   rts.add("cpu1", System.currentTimeMillis()/1000 /* time sec */, 80.0);

   // 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")