This commit is contained in:
@@ -33,17 +33,23 @@ test('normalizeStatsConfig clamps out-of-range values', (t) => {
|
||||
|
||||
test('normalizeStatsConfig accepts seconds aliases from UI', (t) => {
|
||||
const n = normalizeStatsConfig({
|
||||
collectIntervalSec: 5,
|
||||
broadcastIntervalSec: 3,
|
||||
collectIntervalSec: 5, // legacy alias → broadcast when broadcast unset
|
||||
listIntervalSec: 20,
|
||||
concurrency: 4,
|
||||
samplesPerTick: 8,
|
||||
})
|
||||
t.is(n.broadcastIntervalMs, 5000)
|
||||
t.is(n.collectIntervalMs, 5000)
|
||||
t.is(n.broadcastIntervalMs, 3000)
|
||||
t.is(n.listIntervalMs, 20000)
|
||||
t.is(n.concurrency, 4)
|
||||
t.is(n.samplesPerTick, 8)
|
||||
|
||||
const n2 = normalizeStatsConfig({
|
||||
broadcastIntervalSec: 3,
|
||||
collectIntervalSec: 9,
|
||||
})
|
||||
// explicit broadcast wins over legacy collect alias
|
||||
t.is(n2.broadcastIntervalMs, 3000)
|
||||
})
|
||||
|
||||
test('defaultStatsConfig is within limits', (t) => {
|
||||
|
||||
Reference in New Issue
Block a user