[feature] Support custom refresh intervals for each group of metrics
What's changed?
close https://github.com/apache/hertzbeat/issues/2188
Support custom refresh intervals for each group of metrics. The specific implementation is as follows:
- Construct a cycle of job refresh interval list based on the refresh intervals of each metric.
- When the job dispatches, select metrics that are due for refresh to form priorMetrics.
Checklist
- [x] I have read the Contributing Guide
- [x] I have written the necessary doc or comment.
- [x] I have added the necessary unit tests and all cases have passed.
@tomsun28 Hi, the strange problem mentioned here https://github.com/apache/hertzbeat/pull/2271#issuecomment-2232155864 has been solved.
According to the previous code, for jobs with multiple collection metrics, the metrics.setCollectTime execution time for metrics with a higher priority is somewhat delayed. This causes them to be missed during the selection of expired metrics in the next cycle, resulting in updates occurring every two cycles. so I move metrics.setCollectTime in constructPriorMetrics.
Customize collect intervals have been tested and there are no problem.
๐๐thanks LGTM, test passed. Since this involves basic scheduling, and we are preparing a new version, can we merge this major feature after the 1.6.1 release (maybe end of this month)?
๐๐thanks LGTM, test passed. Since this involves basic scheduling, and we are preparing a new version, can we merge this major feature after the 1.6.1 release (maybe end of this month)?
I agree, we need to make this feature more stable before releasing it.
๐ When will this PR plan be merged? I need to use this feature.
When will this PR plan be merged? I need to use this feature.๐