fix(uptime): показывать реальные наблюдения и пропуски RTT на дашборде

This commit is contained in:
Denozordec committed 2026-10-03 23:42:45 +07:00
1 parent 8f65d1620d
commit 9d3129372b
18 files changed
+169 -203

No files matched your search

+1 -1
View File
@@ -8,6 +8,6 @@ test("dashboard server catalog validates identities and keeps unknown status",()
for(const raw of [{},[server,server],[{...server,status:"invalid"}],[{...server,latency:-1}],[{...server,id:0}],[{id:1}]])assert.throws(()=>parseDashboardServers(raw))
})
test("dashboard probes validate real shape, uniqueness and numeric ranges before publication",()=>{
assert.equal(parseDashboardProbes({probes:[probe]}).probes[0].rtt,null);assert.deepEqual(parseDashboardProbes({probes:[]}),{probes:[]})
assert.equal(parseDashboardProbes({probes:[probe]}).probes[0].rtt,null);assert.deepEqual(parseDashboardProbes({probes:[]}),{probes:[],sampledAt:null})
for(const raw of [{},{probes:[probe,probe]},{probes:[{...probe,loss:101}]},{probes:[{...probe,status:"invalid"}]},{probes:[{...probe,series:[null]}]},{probes:[{}]}])assert.throws(()=>parseDashboardProbes(raw))
})