Skip to content

Commit

Permalink
added RTedis TimeSeries tsadd function (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerard <[email protected]>
  • Loading branch information
gde-2 and Gerard authored Nov 13, 2021
1 parent 5b02a78 commit 4ee14cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Redis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ bool Redis::ltrim(const char *key, int start, int stop)
{
TRCMD_EXPECTOK("LTRIM", key, String(start), String(stop));
}

bool Redis::tsadd(const char *key, unsigned long timestamp, const int value)
{
TRCMD_EXPECTOK("TS.ADD" , key, String(timestamp)+"000", String(value));
}

String Redis::info(const char *section)
{
Expand Down Expand Up @@ -260,4 +265,5 @@ RedisSubscribeResult Redis::startSubscribing(RedisMsgCallback messageCallback, R
}

return RedisSubscribeSuccess;
}
}

1 change: 1 addition & 0 deletions Redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ class Redis
*/
bool unsubscribe(const char *channelOrPattern);

bool tsadd(const char *key, unsigned long timestamp, const int value);
/**
* Enters subscription mode and subscribes to all channels/patterns setup via `subscribe()`/`psubscribe()`.
* On success, this call will *block* until stopSubscribing() is called (meaning `loop()` will never be called!), and only *then* will return `RedisSubscribeSuccess`.
Expand Down

0 comments on commit 4ee14cb

Please sign in to comment.