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
+4
View File
@@ -13,6 +13,10 @@ import Foundation
precondition(PanelCurveGeometry.runs(dates: slow, values: [0.1, 0.2, 0.3], maximumGap: 3600, boundaryDates: [slow[1]]).count == 2)
precondition(PanelCurveGeometry.runs(dates: slow, values: [0.1, 0.2, 0.3], maximumGap: 5, intervals: [1800, 1800, 0.5]).count == 1)
precondition(PanelCurveGeometry.runs(dates: slow, values: [0.1, 0.2, 0.3], maximumGap: 5, boundaryDates: [slow[2]], intervals: [1800, 1800, 0.5]).count == 2)
let changed = [0.0, 8, 10, 18].map { Date(timeIntervalSinceReferenceDate: $0) }
precondition(PanelCurveGeometry.runs(dates: changed, values: [0.1, 0.2, 0.3, 0.4],
intervals: [2, 30, 2, 2]).count == 3,
"A slow cadence applies only to its outgoing segment; earlier and later real gaps remain gaps")
let frame = PanelCurveFrame(dates: dates, series: [Array(repeating: 0.3, count: 60)], intervals: Array(repeating: 2, count: 60), boundaryDates: [])
precondition(frame.dates.count == 60)
let domain = PanelCurveFrame.domain(begin: dates.first!, end: dates.last!)