Skip to content
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

[NEW] Add finer granularity latency sampling #10930

Open
sjpotter opened this issue Jul 4, 2022 · 2 comments
Open

[NEW] Add finer granularity latency sampling #10930

sjpotter opened this issue Jul 4, 2022 · 2 comments

Comments

@sjpotter
Copy link
Contributor

sjpotter commented Jul 4, 2022

The problem/use-case that the feature addresses

Currently Redis only supports latency sampling at the millisecond level, this is insufficient for our needs with RedisRaft where we need at least microsecond granularity.

Description of the feature

The idea is that Redis should always store latency measurements in the finer granularity (either micro or nanoseconds). New APIs would be added that take that granularity and exiting APIs would wrap the new APIs with multiplication/division by the appropriate factor to remain compatible.

Alternatives you've considered

Writing our own sampling infrastructure, but seems a waste to not be able to reuse the existing infrastructure and that others might want finer granularity as well.

@oranagra
Copy link
Member

oranagra commented Jul 4, 2022

@sjpotter are you referring to RM_LatencyAddSample and the LATENCY LATEST / HISTORY commands?
or something else?

are you suggesting to add RM_LatencyAddSampleMicros, a new latency-monitor-threshold-micros config, and some units argument to LATENCY LATEST and LATENCY HISTORY?

@sjpotter
Copy link
Contributor Author

sjpotter commented Jul 6, 2022

I'm talking about both. "inputting" and "outputting" the samples. i.e. today , one can only add latency samples in milliseconds, and since its stored as such the LATENCY command only operates on milliseconds.

I'm proposing that we should store everything in finer granularity with new APIs that take the finer granularity (and old APIs just wrap new APIs be internal to redis or exposed via RM API with a factor to convert to finer granularity)

In terms of "output" (LATENCY LATEST, LATENCY HISTORY... or any RM APIs that allow you to access sample data) I'd say yes, adding a unit arguments (with the default either being set by a redis config option or just the current milliseconds) for backwards compatibility.

@oranagra oranagra added this to backlog in 7.2 <obsolete> via automation Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants