@zintrust/queue-monitor 2.2.0 → 2.4.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.
@@ -0,0 +1,124 @@
1
+ {
2
+ "name": "@zintrust/queue-monitor",
3
+ "version": "2.4.0",
4
+ "buildDate": "2026-05-30T23:30:02.940Z",
5
+ "buildEnvironment": {
6
+ "node": "v20.20.2",
7
+ "platform": "linux",
8
+ "arch": "x64"
9
+ },
10
+ "git": {
11
+ "commit": "8357ba1a",
12
+ "branch": "master"
13
+ },
14
+ "package": {
15
+ "engines": {
16
+ "node": ">=20.0.0"
17
+ },
18
+ "dependencies": [
19
+ "bullmq",
20
+ "ioredis"
21
+ ],
22
+ "peerDependencies": [
23
+ "@zintrust/core"
24
+ ]
25
+ },
26
+ "files": {
27
+ "BrandFavicon.d.ts": {
28
+ "size": 81,
29
+ "sha256": "0f477b645fb3df6d3f52ced87c3c0f7dc942e5f4c4710f24866eca3b2e411fb9"
30
+ },
31
+ "BrandFavicon.js": {
32
+ "size": 721,
33
+ "sha256": "33e57f6cec15b8dcb5886ca92644139d2e3ca1789aae1c3a4a066d75a273a6bb"
34
+ },
35
+ "QueueMonitoringService.d.ts": {
36
+ "size": 1698,
37
+ "sha256": "fcd19d80f3fc77b1318594bf45f13afed54febc4334d3aa6be975d3fe3bb73f2"
38
+ },
39
+ "QueueMonitoringService.js": {
40
+ "size": 8935,
41
+ "sha256": "c099e8922dd5642bce33a7db4b4a98641cab16e45a4ab76f989ef76a1178700e"
42
+ },
43
+ "connection.d.ts": {
44
+ "size": 287,
45
+ "sha256": "dcc6ea45e59b0a2e8844b27f466dff4849618c06b74aae62a99c8edd772d0db0"
46
+ },
47
+ "connection.js": {
48
+ "size": 178,
49
+ "sha256": "ff387351f5b8c7c14a7f2ef817fbbb065ad677faffcb47e5e8ddc4b064747e5b"
50
+ },
51
+ "dashboard-index.d.ts": {
52
+ "size": 183,
53
+ "sha256": "9d7c7fc63fe2919de0584d3f3d0ef74166d834af0a68caca2fe6fe64340652b9"
54
+ },
55
+ "dashboard-index.js": {
56
+ "size": 183,
57
+ "sha256": "9d7c7fc63fe2919de0584d3f3d0ef74166d834af0a68caca2fe6fe64340652b9"
58
+ },
59
+ "dashboard-ui.d.ts": {
60
+ "size": 219,
61
+ "sha256": "5140191207b5620500ac5e1edacefed65956a1ad88739695d545ea7d2b405243"
62
+ },
63
+ "dashboard-ui.js": {
64
+ "size": 53927,
65
+ "sha256": "71bab126f20aea1165ee3aa3c82e896ebd89b1f1a815ef2716cd884b846ab34f"
66
+ },
67
+ "driver-index.d.ts": {
68
+ "size": 287,
69
+ "sha256": "915a41bc57b3a5d826832bd4a899861ddbfd15a66ab04f7a599454a248222480"
70
+ },
71
+ "driver-index.js": {
72
+ "size": 184,
73
+ "sha256": "fb91df973acd13a88cca443e50ecdd34944c66e1a1d48333f63099079a00f3c9"
74
+ },
75
+ "driver.d.ts": {
76
+ "size": 1236,
77
+ "sha256": "91f705031e1abd9049e93c49a2cdd00552f41c4693f2f79fb3fbeeb6c67ac85a"
78
+ },
79
+ "driver.js": {
80
+ "size": 6911,
81
+ "sha256": "b29cabaf0010b2aad358af2adab337c28e056e60cdd8b5b7bdd9e95781bc6f56"
82
+ },
83
+ "index.d.ts": {
84
+ "size": 2344,
85
+ "sha256": "370b578ca6412fbdbb2f6966c0899a4c9d6d1ab08defe48a9004564124b1f45e"
86
+ },
87
+ "index.js": {
88
+ "size": 15814,
89
+ "sha256": "bf6f0923142de3047c7317d0e7cd8395b44c21ddebb921fd044b73318c775e9b"
90
+ },
91
+ "metrics-index.d.ts": {
92
+ "size": 239,
93
+ "sha256": "b68d7ca4d15e2380bc7a57e8ff6b00eb19a9f49417f7df88ff20b93cd2aeb00d"
94
+ },
95
+ "metrics-index.js": {
96
+ "size": 171,
97
+ "sha256": "53e858995605858b819f2c48c701e3b8f7d028ec51c1b4814c46284c7fb3989e"
98
+ },
99
+ "metrics.d.ts": {
100
+ "size": 913,
101
+ "sha256": "c68b254af229871ae8d4ad5c2aca00108c07465e0abb336a68a9c2023d2d5776"
102
+ },
103
+ "metrics.js": {
104
+ "size": 3526,
105
+ "sha256": "bec6d546c15a4040eaf637feb974799db85cbdf34a7cb077f7b407da31181f11"
106
+ },
107
+ "runtime-index.d.ts": {
108
+ "size": 2230,
109
+ "sha256": "b4608f964f6c5cdb5469eb320683fee827734adcf1d03ea931766405451f35df"
110
+ },
111
+ "runtime-index.js": {
112
+ "size": 8924,
113
+ "sha256": "494757d540fe57507ac59ef2935ad683cb14fa57dbe188ffe3e6dd9fe3cb1ea9"
114
+ },
115
+ "worker.d.ts": {
116
+ "size": 338,
117
+ "sha256": "6bb39529c68675846d1877b34ccb2fa2bbe9bc56a223388add24e239f24ddfc3"
118
+ },
119
+ "worker.js": {
120
+ "size": 1239,
121
+ "sha256": "46f116eb169fca1dc6dfd48d299001635c48a2da8d6e10115a98fcd33187b53e"
122
+ }
123
+ }
124
+ }
package/dist/driver.js CHANGED
@@ -97,37 +97,30 @@ export const createBullMQDriver = (config) => {
97
97
  };
98
98
  const getJobCountsMany = async (queueNames) => {
99
99
  const uniqueQueueNames = Array.from(new Set(queueNames.filter((queueName) => typeof queueName === 'string' && queueName.trim().length > 0)));
100
- const QUEUE_MONITOR_LOGGING_ENABLED = Env.getBool('QUEUE_MONITOR_LOGGING_ENABLED', false);
101
- if (QUEUE_MONITOR_LOGGING_ENABLED) {
102
- Logger.info('[queue-monitor] getJobCountsMany start', {
100
+ Logger.info('[queue-monitor] getJobCountsMany start', {
101
+ requestedCount: queueNames.length,
102
+ uniqueCount: uniqueQueueNames.length,
103
+ });
104
+ const startedAt = Date.now();
105
+ if (uniqueQueueNames.length === 0) {
106
+ Logger.info('[queue-monitor] getJobCountsMany complete', {
107
+ durationMs: Date.now() - startedAt,
103
108
  requestedCount: queueNames.length,
104
109
  uniqueCount: uniqueQueueNames.length,
110
+ pipelineCount: 0,
105
111
  });
106
- }
107
- const startedAt = Date.now();
108
- if (uniqueQueueNames.length === 0) {
109
- if (QUEUE_MONITOR_LOGGING_ENABLED) {
110
- Logger.info('[queue-monitor] getJobCountsMany complete', {
111
- durationMs: Date.now() - startedAt,
112
- requestedCount: queueNames.length,
113
- uniqueCount: uniqueQueueNames.length,
114
- pipelineCount: 0,
115
- });
116
- }
117
112
  return [];
118
113
  }
119
114
  const stats = await Promise.all(uniqueQueueNames.map(async (name) => {
120
115
  const counts = await getJobCounts(name);
121
116
  return { name, counts };
122
117
  }));
123
- if (QUEUE_MONITOR_LOGGING_ENABLED) {
124
- Logger.info('[queue-monitor] getJobCountsMany complete', {
125
- durationMs: Date.now() - startedAt,
126
- requestedCount: queueNames.length,
127
- uniqueCount: uniqueQueueNames.length,
128
- pipelineCount: uniqueQueueNames.length,
129
- });
130
- }
118
+ Logger.info('[queue-monitor] getJobCountsMany complete', {
119
+ durationMs: Date.now() - startedAt,
120
+ requestedCount: queueNames.length,
121
+ uniqueCount: uniqueQueueNames.length,
122
+ pipelineCount: uniqueQueueNames.length,
123
+ });
131
124
  return stats;
132
125
  };
133
126
  const requeueFromSnapshot = async (queue, snapshot) => {
package/dist/index.js CHANGED
@@ -231,17 +231,14 @@ function createGetSnapshot(driver, startedAt, knownQueues) {
231
231
  const shouldDiscoverQueues = persistedQueues.length === 0;
232
232
  const discoveredQueues = shouldDiscoverQueues ? await driver.getQueues() : [];
233
233
  const queues = Array.from(new Set([...persistedQueues, ...discoveredQueues])).sort((left, right) => left.localeCompare(right));
234
- const QUEUE_MONITOR_LOGGING_ENABLED = Env.getBool('QUEUE_MONITOR_LOGGING_ENABLED', false);
235
- if (QUEUE_MONITOR_LOGGING_ENABLED) {
236
- Logger.info('[queue-monitor] snapshot queue list resolved', {
237
- discoveredCount: discoveredQueues.length,
238
- persistedCount: persistedQueues.length,
239
- totalQueues: queues.length,
240
- usedRedisDiscovery: shouldDiscoverQueues,
241
- skippedRedisDiscovery: !shouldDiscoverQueues,
242
- hasBatchCounts: typeof driver.getJobCountsMany === 'function',
243
- });
244
- }
234
+ Logger.info('[queue-monitor] snapshot queue list resolved', {
235
+ discoveredCount: discoveredQueues.length,
236
+ persistedCount: persistedQueues.length,
237
+ totalQueues: queues.length,
238
+ usedRedisDiscovery: shouldDiscoverQueues,
239
+ skippedRedisDiscovery: !shouldDiscoverQueues,
240
+ hasBatchCounts: typeof driver.getJobCountsMany === 'function',
241
+ });
245
242
  const batchStartedAt = Date.now();
246
243
  const stats = typeof driver.getJobCountsMany === 'function'
247
244
  ? (await driver.getJobCountsMany(queues)).map((item) => ({
@@ -252,14 +249,12 @@ function createGetSnapshot(driver, startedAt, knownQueues) {
252
249
  const counts = await driver.getJobCounts(name);
253
250
  return { name, counts: counts };
254
251
  }));
255
- if (QUEUE_MONITOR_LOGGING_ENABLED) {
256
- Logger.info('[queue-monitor] snapshot queue counts resolved', {
257
- durationMs: Date.now() - batchStartedAt,
258
- totalQueues: queues.length,
259
- returnedQueues: stats.length,
260
- usedBatchCounts: typeof driver.getJobCountsMany === 'function',
261
- });
262
- }
252
+ Logger.info('[queue-monitor] snapshot queue counts resolved', {
253
+ durationMs: Date.now() - batchStartedAt,
254
+ totalQueues: queues.length,
255
+ returnedQueues: stats.length,
256
+ usedBatchCounts: typeof driver.getJobCountsMany === 'function',
257
+ });
263
258
  return {
264
259
  status: 'ok',
265
260
  startedAt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/queue-monitor",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Queue monitoring package for ZinTrust with BullMQ and Redis.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -56,4 +56,4 @@
56
56
  "bullmq": "^5.77.6",
57
57
  "ioredis": "^5.11.0"
58
58
  }
59
- }
59
+ }