Added configurable stats update interval#506
Open
OA6DXV wants to merge 1 commit intortl-airband:unstablefrom
Open
Added configurable stats update interval#506OA6DXV wants to merge 1 commit intortl-airband:unstablefrom
OA6DXV wants to merge 1 commit intortl-airband:unstablefrom
Conversation
gabeschine
reviewed
Oct 22, 2025
| char *stats_filepath = NULL; | ||
| size_t fft_size_log = DEFAULT_FFT_SIZE_LOG; | ||
| size_t fft_size = 1 << fft_size_log; | ||
| int stats_update_interval = 15; // Stats update every 15 seconf by default |
Collaborator
There was a problem hiding this comment.
Suggested change
| int stats_update_interval = 15; // Stats update every 15 seconf by default | |
| int stats_update_interval = 15; // Stats update every 15 seconds by default |
| if(root.exists("stats_filepath")) | ||
| stats_filepath = strdup(root["stats_filepath"]); | ||
| if (root.exists("stats_update_interval")) { | ||
| stats_update_interval = (int)root["stats_update_interval"]; |
Collaborator
There was a problem hiding this comment.
Any validation we should do on the value? Ie, >0?
Collaborator
|
Note to self - exposing this as a config option can be done along with #515 once config unit tests have been added |
Collaborator
|
Second note to self, consider doing this along with #528 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As I mentioned in #505, I am proposing the ability to modify the update interval of the statistics file. Despite the compilation error due to issues in the unstable branch, I am submitting this PR to showcase the necessary code changes to declare the update-stats-frequency variable, which is an integer that defines how many seconds will pass before the file is updated. This file will then be read by Prometheus.
Now, it would only be necessary to add the global variable update-stats-frequency = x; in the configuration file (rtl_airband.conf) so that each user can control the frequency at which the statistics are updated. The modified code still maintains the default 15-second interval if this global variable is not specified, just like the original code does.
The reason for proposing this change is that having the option to configure a shorter update interval and allowing Prometheus to read these values more frequently enables more precise statistics, especially for analyzing signal and noise levels, for example.
Thank you, and I apologize for any mistakes that may exist. I'm not very experienced with Git and pull requests.