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

Metrics for namespace level #755

Open
1 of 2 tasks
liangyuanpeng opened this issue Jul 27, 2022 · 4 comments
Open
1 of 2 tasks

Metrics for namespace level #755

liangyuanpeng opened this issue Jul 27, 2022 · 4 comments
Labels
enhancement type enhancement help wanted Good for newcomers

Comments

@liangyuanpeng
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

Ref: #726
We are using the namespace to separate data between users and it works well.
But the metrics from the info command stats didn't separate by namespace as well.
As a user, we want to know the speed of commands for each namespace.

Solution

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@liangyuanpeng liangyuanpeng added the enhancement type enhancement label Jul 27, 2022
@git-hulk
Copy link
Member

@liangyuanpeng Thanks for your feedback, it makes a lot sense.

@PragmaTwice PragmaTwice added the help wanted Good for newcomers label Sep 10, 2022
@zevin02
Copy link
Contributor

zevin02 commented Apr 21, 2023

Do you want only the data of stats to be isolated according to the namespace, or all parameters of the command INFO are required?

@jihuayu
Copy link
Member

jihuayu commented Jun 4, 2023

Now kvrocks don't save stat data for each namespace, if we need make it we should save stat for each namespace.

we can change Server#stats to a map that save namespace to stat mapping.

This will increase additional cost above:

  1. Roughly 2KB memory usage per namespace
  2. lock namespace-stat map when we add namespace
  3. One more indirect addressing for access stat
  4. Administrator info command need to foreach all namespace stat and count sum/average.

For 1rd we won't have thousands of namespace, so this memory usage is not large.
For 2nd add namespace is low-frequency operation and it is fast.
For 3rd if we think indirect addressing expensive, we can cache it in connect.(I don't think this is necessary)
For 4rd this is not important.

I think them is acceptable. So do we need do it?

@gofort
Copy link

gofort commented May 13, 2024

+1 it would be cool to have this
use case is simple: we see the amount of keys is growing, but we have no idea in which namespace this happens, so now we need to check each namespace manually which is not convenient at all if you have a lot of namespaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type enhancement help wanted Good for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants