Skip to content

Implemented LATENCY HISTOGRAM by always throwing NotImplementedError #2147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,15 @@ def memory_purge(self, **kwargs) -> ResponseT:
"""
return self.execute_command("MEMORY PURGE", **kwargs)

def latency_histogram(self, *args):
"""
This function throws a NotImplementedError since it is intentionally
not supported.
"""
raise NotImplementedError(
"LATENCY HISTOGRAM is intentionally not implemented in the client."
)

def ping(self, **kwargs) -> ResponseT:
"""
Ping the Redis server
Expand Down
5 changes: 5 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4420,6 +4420,11 @@ def test_memory_usage(self, r):
r.set("foo", "bar")
assert isinstance(r.memory_usage("foo"), int)

@skip_if_server_version_lt("7.0.0")
def test_latency_histogram_not_implemented(self, r: redis.Redis):
with pytest.raises(NotImplementedError):
r.latency_histogram()

@pytest.mark.onlynoncluster
@skip_if_server_version_lt("4.0.0")
@skip_if_redis_enterprise()
Expand Down