bullpane 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lua/queueStats.lua +26 -0
- package/dist/server.mjs +1222 -192
- package/migrations/mysql/0011_flow_maps.sql +53 -0
- package/migrations/sqlite/0004_flow_maps.sql +37 -0
- package/package.json +1 -1
- package/web/assets/FlowsPage-C1DrWzZu.css +1 -0
- package/web/assets/FlowsPage-Cp6TR7Wa.js +26 -0
- package/web/assets/{JobTreePage-CxJzFwh9.js → JobTreePage-CbwbeeRl.js} +2 -2
- package/web/assets/McpConsentPage-CI53cgZX.js +1 -0
- package/web/assets/index-BuIZl_Bc.css +1 -0
- package/web/assets/index-Dj9D1-XU.js +553 -0
- package/web/assets/style-J6Fkg5PC.js +23 -0
- package/web/index.html +2 -2
- package/web/assets/FlowsPage-CE4Fl11b.js +0 -6
- package/web/assets/McpConsentPage-CmZMfyo4.js +0 -1
- package/web/assets/flowLayout-GUFMVhrV.js +0 -23
- package/web/assets/index-C2gL_lbF.css +0 -1
- package/web/assets/index-CN2nADIL.js +0 -548
- /package/web/assets/{flowLayout-BnuhLJ6X.css → style-BnuhLJ6X.css} +0 -0
package/dist/lua/queueStats.lua
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
ARGV[2] number of metric points (newest N minutes)
|
|
17
17
|
ARGV[3] window start (unix ms) for the success/failure rate ZCOUNTs
|
|
18
18
|
ARGV[4] `${prefix}:${queue}:` (to read a job's opts and detect retention)
|
|
19
|
+
ARGV[5] max groups whose waiting jobs are summed into [22]; 0 = skip (lists)
|
|
19
20
|
|
|
20
21
|
Returns a flat array:
|
|
21
22
|
[1..8] counts (LLEN for lists, ZCARD for zsets)
|
|
@@ -37,6 +38,10 @@
|
|
|
37
38
|
in the same EVALSHA (no extra round trip to Redis). Worth the budget
|
|
38
39
|
because it is the only way for the `active` tab to say "3 of these hung";
|
|
39
40
|
without it the operator sees "active 8" and cannot tell half are dead.
|
|
41
|
+
[22] BullMQ Pro: jobs waiting in groups (each group's list + its prioritized
|
|
42
|
+
zset), summed over at most ARGV[5] groups. Pro keeps them there, not in
|
|
43
|
+
`wait`, so [1] alone says 0 for a Pro queue full of grouped jobs.
|
|
44
|
+
[23] how many groups were summed into [22]; fewer than [11] = partial sum.
|
|
40
45
|
|
|
41
46
|
Cluster safe: every key belongs to the same queue (same hash tag).
|
|
42
47
|
Read only: the legacy "0:" wait-list marker is skipped, never popped.
|
|
@@ -137,4 +142,25 @@ out[20] = rcall("ZCARD", KEYS[15])
|
|
|
137
142
|
-- hung. SCARD is O(1), so the count rides along for free in this script.
|
|
138
143
|
out[21] = rcall("SCARD", KEYS[16])
|
|
139
144
|
|
|
145
|
+
-- Waiting jobs of BullMQ Pro groups: two O(1) commands per group (LLEN + ZCARD),
|
|
146
|
+
-- walking the four status zsets in Pro's order and stopping at ARGV[5] groups, so
|
|
147
|
+
-- the cost is bounded however many groups a queue has. Only the single-queue page
|
|
148
|
+
-- asks (ARGV[5] = 0 everywhere else), and only a queue with groups pays.
|
|
149
|
+
local groupWaiting, groupsSummed = 0, 0
|
|
150
|
+
local maxGroups = tonumber(ARGV[5]) or 0
|
|
151
|
+
if maxGroups > 0 and groupsCount > 0 then
|
|
152
|
+
local statusKeys = { KEYS[10], ARGV[4] .. "groups:limit", ARGV[4] .. "groups:max", ARGV[4] .. "groups:paused" }
|
|
153
|
+
for _, statusKey in ipairs(statusKeys) do
|
|
154
|
+
local left = maxGroups - groupsSummed
|
|
155
|
+
if left <= 0 then break end
|
|
156
|
+
for _, gid in ipairs(rcall("ZRANGE", statusKey, 0, left - 1)) do
|
|
157
|
+
local groupKey = ARGV[4] .. "groups:" .. gid
|
|
158
|
+
groupWaiting = groupWaiting + rcall("LLEN", groupKey) + rcall("ZCARD", groupKey .. ":p")
|
|
159
|
+
groupsSummed = groupsSummed + 1
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
out[22] = groupWaiting
|
|
164
|
+
out[23] = groupsSummed
|
|
165
|
+
|
|
140
166
|
return out
|