fix(monitors): 修复短暂隐藏重开后的趋势误断层

This commit is contained in:
2026-11-07 14:53:41 +08:00
parent 80706fa52e
commit 050ee30f56
17 changed files with 160 additions and 12 deletions
+3
View File
@@ -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))