-
Notifications
You must be signed in to change notification settings - Fork 436
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
Add cron to recalculate db size #2217
Conversation
8654ab8
to
460649a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It generally looks good to me.
Generally looks good, you can fix the tidy issue according to https://github.com/apache/kvrocks/actions/runs/8526319228/job/23369018645?pr=2217#step:7:1294 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great feature, thank you.
@git-hulk I pre-allocated the namespaces variable, I don't know if it's alright. Any idea why clang-tidy doesn't raise the same error for the command std::vector<std::string> namespaces;
auto tokens = srv->GetNamespace()->List();
for (auto &token : tokens) {
namespaces.emplace_back(token.second); // namespace
namespaces.emplace_back(token.first); // token
}
namespaces.emplace_back(kDefaultNamespace);
namespaces.emplace_back(config->requirepass); |
@kinoute That's right to reserve the space for namespaces. And why it doesn't raise an error in the previous codes, is because it's added before introducing the linter. |
@kinoute Thanks for your contribution. |
Quality Gate failedFailed conditions |
Following RocksLabs/kvrocks_exporter#25, I was wondering if there is any way to automatically recalculate the db size instead of doing it manually through
dbsize scan
with the redis-cli. Because without it, the panel on the Grafana dashboard doesn't make any sense without manual intervention, same for theinfo
command through the CLI or redis client.I thought it would be nice to add a cronjob that could run periodically to run this command on all namespaces to have up-to-date estimated keys number (default: disabled).
This is my first PR here and in C++, I hope I didn't make any mess.