countdown based HK generation #156
@ -14,6 +14,10 @@ void PeriodicHousekeepingHelper::initialize(float collectionInterval,
|
||||
changeCollectionInterval(collectionInterval);
|
||||
}
|
||||
|
||||
float PeriodicHousekeepingHelper::getCollectionIntervalInSeconds() const {
|
||||
return collectionInterval;
|
||||
}
|
||||
|
||||
bool PeriodicHousekeepingHelper::checkOpNecessary() {
|
||||
if (hkGenerationCd.hasTimedOut()) {
|
||||
hkGenerationCd.resetTimer();
|
||||
@ -26,6 +30,8 @@ void PeriodicHousekeepingHelper::changeCollectionInterval(float newIntervalSecon
|
||||
uint32_t intervalMs = newIntervalSeconds * 1000;
|
||||
if (newIntervalSeconds <= 0) {
|
||||
intervalMs = minimumPeriodicInterval;
|
||||
newIntervalSeconds = static_cast<float>(minimumPeriodicInterval) / 1000.0;
|
||||
}
|
||||
collectionInterval = newIntervalSeconds;
|
||||
hkGenerationCd.setTimeout(intervalMs);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ class PeriodicHousekeepingHelper {
|
||||
private:
|
||||
LocalPoolDataSetBase* owner = nullptr;
|
||||
Countdown hkGenerationCd;
|
||||
float collectionInterval = 0.0;
|
||||
|
||||
dur_millis_t minimumPeriodicInterval = 0;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user