From 6487f9555ba2d08083a081df9b65b642427361fa Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 14 Dec 2022 11:17:51 +0200 Subject: Add support for certain LATENCY commands (#2503) * add latency commands * fix tests in cluster --- redis/commands/core.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'redis/commands/core.py') 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 -- cgit v1.2.1