Skip to content

Commit 09a52db

Browse files
dvora-hchayim
andauthored
Implemented LATENCY HISTOGRAM by always throwing NotImplementedError (#2147)
Co-authored-by: Chayim <[email protected]>
1 parent eea88da commit 09a52db

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

redis/commands/core.py

+9
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,15 @@ def memory_purge(self, **kwargs) -> ResponseT:
10641064
"""
10651065
return self.execute_command("MEMORY PURGE", **kwargs)
10661066

1067+
def latency_histogram(self, *args):
1068+
"""
1069+
This function throws a NotImplementedError since it is intentionally
1070+
not supported.
1071+
"""
1072+
raise NotImplementedError(
1073+
"LATENCY HISTOGRAM is intentionally not implemented in the client."
1074+
)
1075+
10671076
def ping(self, **kwargs) -> ResponseT:
10681077
"""
10691078
Ping the Redis server

tests/test_commands.py

+5
Original file line numberDiff line numberDiff line change
@@ -4458,6 +4458,11 @@ def test_memory_usage(self, r):
44584458
r.set("foo", "bar")
44594459
assert isinstance(r.memory_usage("foo"), int)
44604460

4461+
@skip_if_server_version_lt("7.0.0")
4462+
def test_latency_histogram_not_implemented(self, r: redis.Redis):
4463+
with pytest.raises(NotImplementedError):
4464+
r.latency_histogram()
4465+
44614466
@pytest.mark.onlynoncluster
44624467
@skip_if_server_version_lt("4.0.0")
44634468
@skip_if_redis_enterprise()

0 commit comments

Comments
 (0)