queues: service level counts callers who weren't answered
ci / check (push) Successful in 1m4s
ci / images (push) Successful in 19s

withinSlaPercent was "answered within sla_seconds / answered", so a
queue where a caller timed out still showed 100%. It is now the usual
service level: answered within sla_seconds out of every caller the
queue is done with, leaving out those who hung up before sla_seconds
(nobody could have answered them in time). Timed out and turned away
count as missed; callers still waiting aren't counted. Written into
04; the page label says "Callers answered within N s".

Real calls: m8-t1 now shows 50% (1 answered in time, 1 timed out, the
early hang-up left out) and the milestone check 67% (2 of 3), and
asserts it. The check moves to queue 552 (*45552) so it doesn't clash
with m8-t1's 550 on a shared database.

Task: M8-T1
This commit is contained in:
iamdoubz committed 2026-10-19 12:13:39 -05:00
1 parent 088372bff8
commit 4742ed52ea
8 files changed
+28 -17

No files matched your search

+3 -1
View File
@@ -240,7 +240,9 @@ describe.skipIf(!hasTestDb)('/api/queues', () => {
abandoned: 1,
timedOut: 2,
avgWaitSeconds: 24,
withinSlaPercent: 50, // 3 s yes, 45 s no (sla 20 s)
// sla 20 s: 3 s yes; 45 s, the timeout and the turned away no; the 4 s hang-up and the
// caller still waiting don't count
withinSlaPercent: 25,
});
const [taken] = await t.db.select().from(queueCalls).where(eq(queueCalls.uniqueid, '1.1'));
expect(taken).toMatchObject({