diff options
author | dvora-h <67596500+dvora-h@users.noreply.github.com> | 2022-12-14 11:17:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-14 11:17:51 +0200 |
commit | 6487f9555ba2d08083a081df9b65b642427361fa (patch) | |
tree | 26e741fb2fdd7200c20f34185ec6f09d633e0f4c /redis/commands/core.py | |
parent | 3a121bef7bbc5bb5f07b119b0eef2f7527a38eda (diff) | |
download | redis-py-6487f9555ba2d08083a081df9b65b642427361fa.tar.gz |
Add support for certain LATENCY commands (#2503)
* add latency commands
* fix tests in cluster
Diffstat (limited to 'redis/commands/core.py')
-rw-r--r-- | redis/commands/core.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index 2ebd35f..eaedffb 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1151,6 +1151,30 @@ class ManagementCommands(CommandsProtocol): "LATENCY HISTOGRAM is intentionally not implemented in the client." ) + def latency_history(self, event: str) -> ResponseT: + """ + Returns the raw data of the ``event``'s latency spikes time series. + + For more information see https://redis.io/commands/latency-history + """ + return self.execute_command("LATENCY HISTORY", event) + + def latency_latest(self) -> ResponseT: + """ + Reports the latest latency events logged. + + For more information see https://redis.io/commands/latency-latest + """ + return self.execute_command("LATENCY LATEST") + + def latency_reset(self, *events: str) -> ResponseT: + """ + Resets the latency spikes time series of all, or only some, events. + + For more information see https://redis.io/commands/latency-reset + """ + return self.execute_command("LATENCY RESET", *events) + def ping(self, **kwargs) -> ResponseT: """ Ping the Redis server |