public class RedisTimeSeries extends Object
Constructor and Description |
---|
RedisTimeSeries()
Create a new RedisTimeSeries client with default connection to local host
|
RedisTimeSeries(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool) |
RedisTimeSeries(String host,
int port)
Create a new RedisTimeSeries client
|
RedisTimeSeries(String host,
int port,
int timeout,
int poolSize)
Create a new RedisTimeSeries client
|
RedisTimeSeries(String host,
int port,
int timeout,
int poolSize,
String password)
Create a new RedisTimeSeries client
|
Modifier and Type | Method and Description |
---|---|
long |
add(String sourceKey,
long timestamp,
double value)
TS.ADD key timestamp value
|
long |
add(String sourceKey,
long timestamp,
double value,
long retentionTime)
TS.ADD key timestamp value [RETENTION retentionTime]
|
long |
add(String sourceKey,
long timestamp,
double value,
long retentionTime,
Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]
|
long |
add(String sourceKey,
long timestamp,
double value,
Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]
|
boolean |
create(String key)
TS.CREATE key
|
boolean |
create(String key,
long retentionTime)
TS.CREATE key [RETENTION retentionTime]
|
boolean |
create(String key,
long retentionTime,
Map<String,String> labels)
TS.CREATE key [RETENTION retentionTime] [LABELS field value..]
|
boolean |
create(String key,
Map<String,String> labels)
TS.CREATE key [LABELS field value..]
|
boolean |
createRule(String sourceKey,
Aggregation aggregation,
long bucketSize,
String destKey)
TS.CREATERULE sourceKey destKey AGGREGATION aggType retentionTime
|
boolean |
decrBy(String key,
int value,
long timeBucket)
TS.DECRBY key [VALUE] [RESET] [TIME_BUCKET]
|
boolean |
deleteRule(String sourceKey,
String destKey)
TS.DELETERULE SOURCE_KEY DEST_KEY
|
boolean |
incrBy(String key,
int value,
long timeBucket)
TS.INCRBY key value [RESET time-bucket]
|
Info |
info(String key)
TS.INFO key
|
List<Object> |
madd(Measurement... measurements)
TS.MADD key timestamp value [key timestamp value ...]
|
Range[] |
mrange(long from,
long to,
Aggregation aggregation,
long retentionTime,
String... filters)
TS.RANGEBYLABELS key (labels) fromTimestamp toTimestamp [aggregationType] [retentionTime]
|
Value[] |
range(String key,
long from,
long to)
TS.RANGE key fromTimestamp toTimestamp
|
Value[] |
range(String key,
long from,
long to,
Aggregation aggregation,
long retentionTime)
TS.RANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType
retentionTime]
|
public RedisTimeSeries()
public RedisTimeSeries(String host, int port)
host
- the redis hostport
- the redis potpublic RedisTimeSeries(String host, int port, int timeout, int poolSize)
host
- the redis hostport
- the redis potpublic RedisTimeSeries(String host, int port, int timeout, int poolSize, String password)
host
- the redis hostport
- the redis potpassword
- the password for authentication in a password protected Redis serverpublic RedisTimeSeries(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool)
public boolean create(String key)
key
- public boolean create(String key, long retentionTime)
key
- retentionTime
- public boolean create(String key, Map<String,String> labels)
key
- maxSamplesPerChunk
- public boolean create(String key, long retentionTime, Map<String,String> labels)
key
- retentionTime
- maxSamplesPerChunk
- public boolean createRule(String sourceKey, Aggregation aggregation, long bucketSize, String destKey)
sourceKey
- aggregation
- bucketSize
- destKey
- public boolean deleteRule(String sourceKey, String destKey)
sourceKey
- destKey
- public long add(String sourceKey, long timestamp, double value)
sourceKey
- timestamp
- value
- public long add(String sourceKey, long timestamp, double value, long retentionTime)
sourceKey
- timestamp
- value
- retentionTime
- public long add(String sourceKey, long timestamp, double value, Map<String,String> labels)
sourceKey
- timestamp
- value
- labels
- public long add(String sourceKey, long timestamp, double value, long retentionTime, Map<String,String> labels)
sourceKey
- timestamp
- value
- retentionTime
- labels
- public List<Object> madd(Measurement... measurements)
measurements
- public Value[] range(String key, long from, long to)
key
- from
- to
- public Value[] range(String key, long from, long to, Aggregation aggregation, long retentionTime)
key
- from
- to
- aggregation
- retentionTime
- public Range[] mrange(long from, long to, Aggregation aggregation, long retentionTime, String... filters)
key
- from
- to
- aggregation
- retentionTime
- filters
- public boolean incrBy(String key, int value, long timeBucket)
key
- value
- timeBucket
- public boolean decrBy(String key, int value, long timeBucket)
key
- value
- timeBucket
- Copyright © 2019. All rights reserved.