fix(monitors): 修复短暂隐藏重开后的趋势误断层
This commit is contained in:
@@ -54,6 +54,9 @@ final class MetricsStore {
|
||||
needsHistoryBoundary = needsHistoryBoundary || reset
|
||||
scheduledInterval = effectiveMilliseconds
|
||||
guard hasSamplingDemand else { needsHistoryBoundary = true; return }
|
||||
if !needsHistoryBoundary {
|
||||
history.recordScheduledInterval(Double(scheduledInterval) / 1000)
|
||||
}
|
||||
var delay = Duration.zero
|
||||
if !sampleImmediately, let lastPublishedAt {
|
||||
delay = max(.zero, .milliseconds(effectiveMilliseconds) - lastPublishedAt.duration(to: .now))
|
||||
|
||||
Reference in New Issue
Block a user