[skip-ci] fix: TSDB metric collection & config load from disk#5426
Conversation
- `tsdb_sampler_loop()` calls `registry->Collect()` without refreshing module metrics, causing stale metric values to be stored in the TSDB. - Added `update_modules_metrics()` call before `Collect()` in the sampler. Signed-off-by: Wazir Ahmed <wazir@proxysql.com>
- TSDB variables stored on disk were not being loaded into runtime during startup. Add the missing `flush_tsdb_variables___database_to_runtime()` and invoke it during init. - Inline the existing load/save wrappers in the header as thin delegations to the underlying flush functions Signed-off-by: Wazir Ahmed <wazir@proxysql.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @wazir-ahmed, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves two key issues within ProxySQL's Time Series Database (TSDB) functionality. It guarantees the accuracy of collected metrics by ensuring all module metrics are updated prior to TSDB collection. Furthermore, it rectifies a problem where TSDB-related configuration variables stored on disk were not being loaded into the runtime during initialization, thereby ensuring proper application and persistence of these settings across restarts. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses two issues with the TSDB functionality. First, it ensures that metrics are refreshed before collection in the TSDB sampler loop by adding a call to update_modules_metrics(), preventing stale data from being stored. Second, it fixes a bug where TSDB configuration variables were not loaded from disk on startup by adding the necessary flush_tsdb_variables___database_to_runtime() call during initialization. The changes also include a refactoring of TSDB variable handling to use generic flushing functions, which improves code consistency and maintainability. The fixes appear correct and well-implemented.
|



tsdb_sampler_loop()callsregistry->Collect()without refreshing module metrics, causing stale metric values to be stored in the TSDB. Addedupdate_modules_metrics()call beforeCollect()in the sampler.TSDB variables stored on disk were not being loaded into runtime during startup. Added the missing
flush_tsdb_variables___database_to_runtime()and invoke it during init.Summary by CodeRabbit
New Features
Refactor