bunqueue-dashboard 0.0.27 → 0.0.28
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/.vite/manifest.json +63 -63
- package/dist/assets/AddJob-BWQUAkBR.js +3 -0
- package/dist/assets/{Alerts-DyA39_uq.js → Alerts-B0xnP5CV.js} +1 -1
- package/dist/assets/{Benchmark-B3KDk7ue.js → Benchmark-Dw6Adnj6.js} +1 -1
- package/dist/assets/{BulkAddJobs-tL300nBi.js → BulkAddJobs-DAdNpGRo.js} +1 -1
- package/dist/assets/{CopilotPanel-PMVR2Cd3.js → CopilotPanel-Bpxw4K9a.js} +1 -1
- package/dist/assets/{Cron-C_gbmPNI.js → Cron-CV32TamV.js} +1 -1
- package/dist/assets/CronManager-BEaa7wiR.js +1 -0
- package/dist/assets/{Database-LKuDZO6v.js → Database-ehv_cEQ2.js} +1 -1
- package/dist/assets/Diagnostics-CorlmvKz.js +1 -0
- package/dist/assets/{Dlq-Bz22b8rz.js → Dlq-Ctk9zeER.js} +1 -1
- package/dist/assets/{DlqControl-bZK1IQiC.js → DlqControl-CIsg8otQ.js} +1 -1
- package/dist/assets/{DlqPro-7QuH6aNZ.js → DlqPro-Bw3yQpGs.js} +1 -1
- package/dist/assets/{Flows-DpehOAzf.js → Flows-rrvRgRtA.js} +1 -1
- package/dist/assets/JobInspector-C7vAErSx.js +2 -0
- package/dist/assets/{Jobs-DHJqAWws.js → Jobs-5faPmBs1.js} +1 -1
- package/dist/assets/{JobsPro-COyxqkNn.js → JobsPro-BOkJw2tF.js} +1 -1
- package/dist/assets/{Logs-DoaPBM7P.js → Logs-BFVWi8D3.js} +1 -1
- package/dist/assets/{LogsPro-CnAAAWPH.js → LogsPro-CkwTCyHD.js} +1 -1
- package/dist/assets/{McpServer-XBSHRJpK.js → McpServer-Bs9xBhXn.js} +1 -1
- package/dist/assets/{Metrics-qqHBt5Mq.js → Metrics-cYFyZR3N.js} +1 -1
- package/dist/assets/{MetricsPro-1p0Rpacn.js → MetricsPro-DFQhOiMq.js} +1 -1
- package/dist/assets/{Overview-DWCFawq-.js → Overview-CtPFwJ89.js} +1 -1
- package/dist/assets/{Pagination-vdXIy1LL.js → Pagination-C_ycPjHn.js} +1 -1
- package/dist/assets/{QueueActions-CzenZmRB.js → QueueActions-BIJ-MHWn.js} +1 -1
- package/dist/assets/{QueueControl-BNW57gvM.js → QueueControl-OXvmyeYT.js} +1 -1
- package/dist/assets/{QueueDetail-w7VUvfk9.js → QueueDetail-DJZ30jtl.js} +1 -1
- package/dist/assets/QueueDetailPro-DwOCQfIi.js +1 -0
- package/dist/assets/{Queues-Bie4azaQ.js → Queues-j0iVmzXB.js} +1 -1
- package/dist/assets/{QueuesOverview-BUTDdZ1o.js → QueuesOverview-LFhAaVxQ.js} +1 -1
- package/dist/assets/{S3Backup-BFA23J_Y.js → S3Backup-B02cXBEq.js} +1 -1
- package/dist/assets/{S3BackupPro-I_YK8ufb.js → S3BackupPro-k_zofIyL.js} +1 -1
- package/dist/assets/{ServerControl-CuAmFqD3.js → ServerControl-P8h0f0HD.js} +1 -1
- package/dist/assets/{Settings-BOTyxPXb.js → Settings-BE7LB_rx.js} +1 -1
- package/dist/assets/{Usage-DP6SPxu5.js → Usage-DRq_sm9A.js} +1 -1
- package/dist/assets/{UsagePro-DteL5Ez5.js → UsagePro-CaEgDStT.js} +1 -1
- package/dist/assets/{Webhooks-LwgtwNkr.js → Webhooks-DUtMCoyF.js} +1 -1
- package/dist/assets/{Workers-C-5dO7Go.js → Workers-DPryLaxE.js} +1 -1
- package/dist/assets/{WorkersPro-DFhuR9f0.js → WorkersPro-DlHDhoV4.js} +1 -1
- package/dist/assets/index-BxYFC0LS.js +8 -0
- package/dist/assets/index-mF63w920.css +1 -0
- package/dist/assets/{install-Bo6DRivH.js → install-DhTYJCUC.js} +1 -1
- package/dist/assets/{useThroughputSeries-D-_zB_EP.js → useThroughputSeries-BuNc_qkH.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/scripts/embedded.gen.ts +104 -104
- package/dist/assets/AddJob-kPPv3bPb.js +0 -3
- package/dist/assets/CronManager-DC9YMFWw.js +0 -1
- package/dist/assets/Diagnostics-02P8kK0A.js +0 -1
- package/dist/assets/JobInspector-D9cxknvv.js +0 -2
- package/dist/assets/QueueDetailPro-C6Ztytkp.js +0 -1
- package/dist/assets/index-D9IOUE5C.js +0 -8
- package/dist/assets/index-KoYkT_4d.css +0 -1
package/dist/.vite/manifest.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"_react-vendor-B68RYDeC.js"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"_Pagination-
|
|
11
|
-
"file": "assets/Pagination-
|
|
10
|
+
"_Pagination-C_ycPjHn.js": {
|
|
11
|
+
"file": "assets/Pagination-C_ycPjHn.js",
|
|
12
12
|
"name": "Pagination",
|
|
13
13
|
"imports": [
|
|
14
14
|
"_cn-CMFYpumL.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"index.html"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
-
"_QueueActions-
|
|
20
|
-
"file": "assets/QueueActions-
|
|
19
|
+
"_QueueActions-BIJ-MHWn.js": {
|
|
20
|
+
"file": "assets/QueueActions-BIJ-MHWn.js",
|
|
21
21
|
"name": "QueueActions",
|
|
22
22
|
"imports": [
|
|
23
23
|
"_cn-CMFYpumL.js",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"_cn-CMFYpumL.js"
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
|
-
"_useThroughputSeries-
|
|
69
|
-
"file": "assets/useThroughputSeries-
|
|
68
|
+
"_useThroughputSeries-BuNc_qkH.js": {
|
|
69
|
+
"file": "assets/useThroughputSeries-BuNc_qkH.js",
|
|
70
70
|
"name": "useThroughputSeries",
|
|
71
71
|
"imports": [
|
|
72
72
|
"_cn-CMFYpumL.js",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"index.html": {
|
|
78
|
-
"file": "assets/index-
|
|
78
|
+
"file": "assets/index-BxYFC0LS.js",
|
|
79
79
|
"name": "index",
|
|
80
80
|
"src": "index.html",
|
|
81
81
|
"isEntry": true,
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"src/lib/demo/install.ts"
|
|
125
125
|
],
|
|
126
126
|
"css": [
|
|
127
|
-
"assets/index-
|
|
127
|
+
"assets/index-mF63w920.css"
|
|
128
128
|
],
|
|
129
129
|
"assets": [
|
|
130
130
|
"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"src": "node_modules/@fontsource-variable/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2"
|
|
151
151
|
},
|
|
152
152
|
"src/components/copilot/CopilotPanel.tsx": {
|
|
153
|
-
"file": "assets/CopilotPanel-
|
|
153
|
+
"file": "assets/CopilotPanel-Bpxw4K9a.js",
|
|
154
154
|
"name": "CopilotPanel",
|
|
155
155
|
"src": "src/components/copilot/CopilotPanel.tsx",
|
|
156
156
|
"isDynamicEntry": true,
|
|
@@ -162,13 +162,13 @@
|
|
|
162
162
|
]
|
|
163
163
|
},
|
|
164
164
|
"src/lib/demo/install.ts": {
|
|
165
|
-
"file": "assets/install-
|
|
165
|
+
"file": "assets/install-DhTYJCUC.js",
|
|
166
166
|
"name": "install",
|
|
167
167
|
"src": "src/lib/demo/install.ts",
|
|
168
168
|
"isDynamicEntry": true
|
|
169
169
|
},
|
|
170
170
|
"src/pages/Alerts.tsx": {
|
|
171
|
-
"file": "assets/Alerts-
|
|
171
|
+
"file": "assets/Alerts-B0xnP5CV.js",
|
|
172
172
|
"name": "Alerts",
|
|
173
173
|
"src": "src/pages/Alerts.tsx",
|
|
174
174
|
"isDynamicEntry": true,
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
]
|
|
181
181
|
},
|
|
182
182
|
"src/pages/Cron.tsx": {
|
|
183
|
-
"file": "assets/Cron-
|
|
183
|
+
"file": "assets/Cron-CV32TamV.js",
|
|
184
184
|
"name": "Cron",
|
|
185
185
|
"src": "src/pages/Cron.tsx",
|
|
186
186
|
"isDynamicEntry": true,
|
|
@@ -188,11 +188,11 @@
|
|
|
188
188
|
"_cn-CMFYpumL.js",
|
|
189
189
|
"_react-vendor-B68RYDeC.js",
|
|
190
190
|
"index.html",
|
|
191
|
-
"_Pagination-
|
|
191
|
+
"_Pagination-C_ycPjHn.js"
|
|
192
192
|
]
|
|
193
193
|
},
|
|
194
194
|
"src/pages/Dlq.tsx": {
|
|
195
|
-
"file": "assets/Dlq-
|
|
195
|
+
"file": "assets/Dlq-Ctk9zeER.js",
|
|
196
196
|
"name": "Dlq",
|
|
197
197
|
"src": "src/pages/Dlq.tsx",
|
|
198
198
|
"isDynamicEntry": true,
|
|
@@ -201,11 +201,11 @@
|
|
|
201
201
|
"_react-vendor-B68RYDeC.js",
|
|
202
202
|
"index.html",
|
|
203
203
|
"_form-C-zZyKfB.js",
|
|
204
|
-
"_Pagination-
|
|
204
|
+
"_Pagination-C_ycPjHn.js"
|
|
205
205
|
]
|
|
206
206
|
},
|
|
207
207
|
"src/pages/Jobs.tsx": {
|
|
208
|
-
"file": "assets/Jobs-
|
|
208
|
+
"file": "assets/Jobs-5faPmBs1.js",
|
|
209
209
|
"name": "Jobs",
|
|
210
210
|
"src": "src/pages/Jobs.tsx",
|
|
211
211
|
"isDynamicEntry": true,
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
]
|
|
218
218
|
},
|
|
219
219
|
"src/pages/Logs.tsx": {
|
|
220
|
-
"file": "assets/Logs-
|
|
220
|
+
"file": "assets/Logs-BFVWi8D3.js",
|
|
221
221
|
"name": "Logs",
|
|
222
222
|
"src": "src/pages/Logs.tsx",
|
|
223
223
|
"isDynamicEntry": true,
|
|
@@ -226,11 +226,11 @@
|
|
|
226
226
|
"_react-vendor-B68RYDeC.js",
|
|
227
227
|
"index.html",
|
|
228
228
|
"_form-C-zZyKfB.js",
|
|
229
|
-
"_Pagination-
|
|
229
|
+
"_Pagination-C_ycPjHn.js"
|
|
230
230
|
]
|
|
231
231
|
},
|
|
232
232
|
"src/pages/Metrics.tsx": {
|
|
233
|
-
"file": "assets/Metrics-
|
|
233
|
+
"file": "assets/Metrics-cYFyZR3N.js",
|
|
234
234
|
"name": "Metrics",
|
|
235
235
|
"src": "src/pages/Metrics.tsx",
|
|
236
236
|
"isDynamicEntry": true,
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
]
|
|
241
241
|
},
|
|
242
242
|
"src/pages/Overview.tsx": {
|
|
243
|
-
"file": "assets/Overview-
|
|
243
|
+
"file": "assets/Overview-CtPFwJ89.js",
|
|
244
244
|
"name": "Overview",
|
|
245
245
|
"src": "src/pages/Overview.tsx",
|
|
246
246
|
"isDynamicEntry": true,
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
]
|
|
251
251
|
},
|
|
252
252
|
"src/pages/QueueDetail.tsx": {
|
|
253
|
-
"file": "assets/QueueDetail-
|
|
253
|
+
"file": "assets/QueueDetail-DJZ30jtl.js",
|
|
254
254
|
"name": "QueueDetail",
|
|
255
255
|
"src": "src/pages/QueueDetail.tsx",
|
|
256
256
|
"isDynamicEntry": true,
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
]
|
|
263
263
|
},
|
|
264
264
|
"src/pages/Queues.tsx": {
|
|
265
|
-
"file": "assets/Queues-
|
|
265
|
+
"file": "assets/Queues-j0iVmzXB.js",
|
|
266
266
|
"name": "Queues",
|
|
267
267
|
"src": "src/pages/Queues.tsx",
|
|
268
268
|
"isDynamicEntry": true,
|
|
@@ -270,11 +270,11 @@
|
|
|
270
270
|
"_cn-CMFYpumL.js",
|
|
271
271
|
"_react-vendor-B68RYDeC.js",
|
|
272
272
|
"index.html",
|
|
273
|
-
"_Pagination-
|
|
273
|
+
"_Pagination-C_ycPjHn.js"
|
|
274
274
|
]
|
|
275
275
|
},
|
|
276
276
|
"src/pages/S3Backup.tsx": {
|
|
277
|
-
"file": "assets/S3Backup-
|
|
277
|
+
"file": "assets/S3Backup-B02cXBEq.js",
|
|
278
278
|
"name": "S3Backup",
|
|
279
279
|
"src": "src/pages/S3Backup.tsx",
|
|
280
280
|
"isDynamicEntry": true,
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
]
|
|
285
285
|
},
|
|
286
286
|
"src/pages/Settings.tsx": {
|
|
287
|
-
"file": "assets/Settings-
|
|
287
|
+
"file": "assets/Settings-BE7LB_rx.js",
|
|
288
288
|
"name": "Settings",
|
|
289
289
|
"src": "src/pages/Settings.tsx",
|
|
290
290
|
"isDynamicEntry": true,
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
]
|
|
298
298
|
},
|
|
299
299
|
"src/pages/Usage.tsx": {
|
|
300
|
-
"file": "assets/Usage-
|
|
300
|
+
"file": "assets/Usage-DRq_sm9A.js",
|
|
301
301
|
"name": "Usage",
|
|
302
302
|
"src": "src/pages/Usage.tsx",
|
|
303
303
|
"isDynamicEntry": true,
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
]
|
|
308
308
|
},
|
|
309
309
|
"src/pages/Workers.tsx": {
|
|
310
|
-
"file": "assets/Workers-
|
|
310
|
+
"file": "assets/Workers-DPryLaxE.js",
|
|
311
311
|
"name": "Workers",
|
|
312
312
|
"src": "src/pages/Workers.tsx",
|
|
313
313
|
"isDynamicEntry": true,
|
|
@@ -315,11 +315,11 @@
|
|
|
315
315
|
"_cn-CMFYpumL.js",
|
|
316
316
|
"_react-vendor-B68RYDeC.js",
|
|
317
317
|
"index.html",
|
|
318
|
-
"_Pagination-
|
|
318
|
+
"_Pagination-C_ycPjHn.js"
|
|
319
319
|
]
|
|
320
320
|
},
|
|
321
321
|
"src/pages/control/AddJob.tsx": {
|
|
322
|
-
"file": "assets/AddJob-
|
|
322
|
+
"file": "assets/AddJob-BWQUAkBR.js",
|
|
323
323
|
"name": "AddJob",
|
|
324
324
|
"src": "src/pages/control/AddJob.tsx",
|
|
325
325
|
"isDynamicEntry": true,
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
]
|
|
332
332
|
},
|
|
333
333
|
"src/pages/control/Benchmark.tsx": {
|
|
334
|
-
"file": "assets/Benchmark-
|
|
334
|
+
"file": "assets/Benchmark-Dw6Adnj6.js",
|
|
335
335
|
"name": "Benchmark",
|
|
336
336
|
"src": "src/pages/control/Benchmark.tsx",
|
|
337
337
|
"isDynamicEntry": true,
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
]
|
|
346
346
|
},
|
|
347
347
|
"src/pages/control/BulkAddJobs.tsx": {
|
|
348
|
-
"file": "assets/BulkAddJobs-
|
|
348
|
+
"file": "assets/BulkAddJobs-DAdNpGRo.js",
|
|
349
349
|
"name": "BulkAddJobs",
|
|
350
350
|
"src": "src/pages/control/BulkAddJobs.tsx",
|
|
351
351
|
"isDynamicEntry": true,
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
]
|
|
358
358
|
},
|
|
359
359
|
"src/pages/control/CronManager.tsx": {
|
|
360
|
-
"file": "assets/CronManager-
|
|
360
|
+
"file": "assets/CronManager-BEaa7wiR.js",
|
|
361
361
|
"name": "CronManager",
|
|
362
362
|
"src": "src/pages/control/CronManager.tsx",
|
|
363
363
|
"isDynamicEntry": true,
|
|
@@ -366,11 +366,11 @@
|
|
|
366
366
|
"_react-vendor-B68RYDeC.js",
|
|
367
367
|
"index.html",
|
|
368
368
|
"_form-C-zZyKfB.js",
|
|
369
|
-
"_Pagination-
|
|
369
|
+
"_Pagination-C_ycPjHn.js"
|
|
370
370
|
]
|
|
371
371
|
},
|
|
372
372
|
"src/pages/control/Database.tsx": {
|
|
373
|
-
"file": "assets/Database-
|
|
373
|
+
"file": "assets/Database-ehv_cEQ2.js",
|
|
374
374
|
"name": "Database",
|
|
375
375
|
"src": "src/pages/control/Database.tsx",
|
|
376
376
|
"isDynamicEntry": true,
|
|
@@ -379,11 +379,11 @@
|
|
|
379
379
|
"_react-vendor-B68RYDeC.js",
|
|
380
380
|
"index.html",
|
|
381
381
|
"_form-C-zZyKfB.js",
|
|
382
|
-
"_Pagination-
|
|
382
|
+
"_Pagination-C_ycPjHn.js"
|
|
383
383
|
]
|
|
384
384
|
},
|
|
385
385
|
"src/pages/control/Diagnostics.tsx": {
|
|
386
|
-
"file": "assets/Diagnostics-
|
|
386
|
+
"file": "assets/Diagnostics-CorlmvKz.js",
|
|
387
387
|
"name": "Diagnostics",
|
|
388
388
|
"src": "src/pages/control/Diagnostics.tsx",
|
|
389
389
|
"isDynamicEntry": true,
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
]
|
|
395
395
|
},
|
|
396
396
|
"src/pages/control/DlqControl.tsx": {
|
|
397
|
-
"file": "assets/DlqControl-
|
|
397
|
+
"file": "assets/DlqControl-CIsg8otQ.js",
|
|
398
398
|
"name": "DlqControl",
|
|
399
399
|
"src": "src/pages/control/DlqControl.tsx",
|
|
400
400
|
"isDynamicEntry": true,
|
|
@@ -403,12 +403,12 @@
|
|
|
403
403
|
"_react-vendor-B68RYDeC.js",
|
|
404
404
|
"index.html",
|
|
405
405
|
"_form-C-zZyKfB.js",
|
|
406
|
-
"_Pagination-
|
|
406
|
+
"_Pagination-C_ycPjHn.js",
|
|
407
407
|
"_exportFile-tdUeW5m5.js"
|
|
408
408
|
]
|
|
409
409
|
},
|
|
410
410
|
"src/pages/control/DlqPro.tsx": {
|
|
411
|
-
"file": "assets/DlqPro-
|
|
411
|
+
"file": "assets/DlqPro-Bw3yQpGs.js",
|
|
412
412
|
"name": "DlqPro",
|
|
413
413
|
"src": "src/pages/control/DlqPro.tsx",
|
|
414
414
|
"isDynamicEntry": true,
|
|
@@ -417,13 +417,13 @@
|
|
|
417
417
|
"_react-vendor-B68RYDeC.js",
|
|
418
418
|
"index.html",
|
|
419
419
|
"_form-C-zZyKfB.js",
|
|
420
|
-
"_Pagination-
|
|
420
|
+
"_Pagination-C_ycPjHn.js",
|
|
421
421
|
"_exportFile-tdUeW5m5.js",
|
|
422
422
|
"_promisePool-Daxkc1OB.js"
|
|
423
423
|
]
|
|
424
424
|
},
|
|
425
425
|
"src/pages/control/Flows.tsx": {
|
|
426
|
-
"file": "assets/Flows-
|
|
426
|
+
"file": "assets/Flows-rrvRgRtA.js",
|
|
427
427
|
"name": "Flows",
|
|
428
428
|
"src": "src/pages/control/Flows.tsx",
|
|
429
429
|
"isDynamicEntry": true,
|
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
]
|
|
435
435
|
},
|
|
436
436
|
"src/pages/control/JobInspector.tsx": {
|
|
437
|
-
"file": "assets/JobInspector-
|
|
437
|
+
"file": "assets/JobInspector-C7vAErSx.js",
|
|
438
438
|
"name": "JobInspector",
|
|
439
439
|
"src": "src/pages/control/JobInspector.tsx",
|
|
440
440
|
"isDynamicEntry": true,
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
]
|
|
449
449
|
},
|
|
450
450
|
"src/pages/control/JobsPro.tsx": {
|
|
451
|
-
"file": "assets/JobsPro-
|
|
451
|
+
"file": "assets/JobsPro-BOkJw2tF.js",
|
|
452
452
|
"name": "JobsPro",
|
|
453
453
|
"src": "src/pages/control/JobsPro.tsx",
|
|
454
454
|
"isDynamicEntry": true,
|
|
@@ -457,13 +457,13 @@
|
|
|
457
457
|
"_react-vendor-B68RYDeC.js",
|
|
458
458
|
"index.html",
|
|
459
459
|
"_form-C-zZyKfB.js",
|
|
460
|
-
"_Pagination-
|
|
460
|
+
"_Pagination-C_ycPjHn.js",
|
|
461
461
|
"_exportFile-tdUeW5m5.js",
|
|
462
462
|
"_jobActions-CuOdMglt.js"
|
|
463
463
|
]
|
|
464
464
|
},
|
|
465
465
|
"src/pages/control/LogsPro.tsx": {
|
|
466
|
-
"file": "assets/LogsPro-
|
|
466
|
+
"file": "assets/LogsPro-CkwTCyHD.js",
|
|
467
467
|
"name": "LogsPro",
|
|
468
468
|
"src": "src/pages/control/LogsPro.tsx",
|
|
469
469
|
"isDynamicEntry": true,
|
|
@@ -472,11 +472,11 @@
|
|
|
472
472
|
"_react-vendor-B68RYDeC.js",
|
|
473
473
|
"index.html",
|
|
474
474
|
"_form-C-zZyKfB.js",
|
|
475
|
-
"_Pagination-
|
|
475
|
+
"_Pagination-C_ycPjHn.js"
|
|
476
476
|
]
|
|
477
477
|
},
|
|
478
478
|
"src/pages/control/McpServer.tsx": {
|
|
479
|
-
"file": "assets/McpServer-
|
|
479
|
+
"file": "assets/McpServer-Bs9xBhXn.js",
|
|
480
480
|
"name": "McpServer",
|
|
481
481
|
"src": "src/pages/control/McpServer.tsx",
|
|
482
482
|
"isDynamicEntry": true,
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
]
|
|
487
487
|
},
|
|
488
488
|
"src/pages/control/MetricsPro.tsx": {
|
|
489
|
-
"file": "assets/MetricsPro-
|
|
489
|
+
"file": "assets/MetricsPro-DFQhOiMq.js",
|
|
490
490
|
"name": "MetricsPro",
|
|
491
491
|
"src": "src/pages/control/MetricsPro.tsx",
|
|
492
492
|
"isDynamicEntry": true,
|
|
@@ -494,13 +494,13 @@
|
|
|
494
494
|
"_cn-CMFYpumL.js",
|
|
495
495
|
"_react-vendor-B68RYDeC.js",
|
|
496
496
|
"index.html",
|
|
497
|
-
"_Pagination-
|
|
497
|
+
"_Pagination-C_ycPjHn.js",
|
|
498
498
|
"_AreaChart-Dl_9G6GH.js",
|
|
499
|
-
"_useThroughputSeries-
|
|
499
|
+
"_useThroughputSeries-BuNc_qkH.js"
|
|
500
500
|
]
|
|
501
501
|
},
|
|
502
502
|
"src/pages/control/QueueControl.tsx": {
|
|
503
|
-
"file": "assets/QueueControl-
|
|
503
|
+
"file": "assets/QueueControl-OXvmyeYT.js",
|
|
504
504
|
"name": "QueueControl",
|
|
505
505
|
"src": "src/pages/control/QueueControl.tsx",
|
|
506
506
|
"isDynamicEntry": true,
|
|
@@ -509,11 +509,11 @@
|
|
|
509
509
|
"_react-vendor-B68RYDeC.js",
|
|
510
510
|
"index.html",
|
|
511
511
|
"_form-C-zZyKfB.js",
|
|
512
|
-
"_QueueActions-
|
|
512
|
+
"_QueueActions-BIJ-MHWn.js"
|
|
513
513
|
]
|
|
514
514
|
},
|
|
515
515
|
"src/pages/control/QueueDetailPro.tsx": {
|
|
516
|
-
"file": "assets/QueueDetailPro-
|
|
516
|
+
"file": "assets/QueueDetailPro-DwOCQfIi.js",
|
|
517
517
|
"name": "QueueDetailPro",
|
|
518
518
|
"src": "src/pages/control/QueueDetailPro.tsx",
|
|
519
519
|
"isDynamicEntry": true,
|
|
@@ -522,12 +522,12 @@
|
|
|
522
522
|
"_react-vendor-B68RYDeC.js",
|
|
523
523
|
"index.html",
|
|
524
524
|
"_AreaChart-Dl_9G6GH.js",
|
|
525
|
-
"_useThroughputSeries-
|
|
526
|
-
"_QueueActions-
|
|
525
|
+
"_useThroughputSeries-BuNc_qkH.js",
|
|
526
|
+
"_QueueActions-BIJ-MHWn.js"
|
|
527
527
|
]
|
|
528
528
|
},
|
|
529
529
|
"src/pages/control/QueuesOverview.tsx": {
|
|
530
|
-
"file": "assets/QueuesOverview-
|
|
530
|
+
"file": "assets/QueuesOverview-LFhAaVxQ.js",
|
|
531
531
|
"name": "QueuesOverview",
|
|
532
532
|
"src": "src/pages/control/QueuesOverview.tsx",
|
|
533
533
|
"isDynamicEntry": true,
|
|
@@ -535,12 +535,12 @@
|
|
|
535
535
|
"_cn-CMFYpumL.js",
|
|
536
536
|
"_react-vendor-B68RYDeC.js",
|
|
537
537
|
"index.html",
|
|
538
|
-
"_Pagination-
|
|
538
|
+
"_Pagination-C_ycPjHn.js",
|
|
539
539
|
"_promisePool-Daxkc1OB.js"
|
|
540
540
|
]
|
|
541
541
|
},
|
|
542
542
|
"src/pages/control/S3BackupPro.tsx": {
|
|
543
|
-
"file": "assets/S3BackupPro-
|
|
543
|
+
"file": "assets/S3BackupPro-k_zofIyL.js",
|
|
544
544
|
"name": "S3BackupPro",
|
|
545
545
|
"src": "src/pages/control/S3BackupPro.tsx",
|
|
546
546
|
"isDynamicEntry": true,
|
|
@@ -553,7 +553,7 @@
|
|
|
553
553
|
]
|
|
554
554
|
},
|
|
555
555
|
"src/pages/control/ServerControl.tsx": {
|
|
556
|
-
"file": "assets/ServerControl-
|
|
556
|
+
"file": "assets/ServerControl-P8h0f0HD.js",
|
|
557
557
|
"name": "ServerControl",
|
|
558
558
|
"src": "src/pages/control/ServerControl.tsx",
|
|
559
559
|
"isDynamicEntry": true,
|
|
@@ -565,7 +565,7 @@
|
|
|
565
565
|
]
|
|
566
566
|
},
|
|
567
567
|
"src/pages/control/UsagePro.tsx": {
|
|
568
|
-
"file": "assets/UsagePro-
|
|
568
|
+
"file": "assets/UsagePro-CaEgDStT.js",
|
|
569
569
|
"name": "UsagePro",
|
|
570
570
|
"src": "src/pages/control/UsagePro.tsx",
|
|
571
571
|
"isDynamicEntry": true,
|
|
@@ -575,7 +575,7 @@
|
|
|
575
575
|
]
|
|
576
576
|
},
|
|
577
577
|
"src/pages/control/Webhooks.tsx": {
|
|
578
|
-
"file": "assets/Webhooks-
|
|
578
|
+
"file": "assets/Webhooks-DUtMCoyF.js",
|
|
579
579
|
"name": "Webhooks",
|
|
580
580
|
"src": "src/pages/control/Webhooks.tsx",
|
|
581
581
|
"isDynamicEntry": true,
|
|
@@ -584,11 +584,11 @@
|
|
|
584
584
|
"_react-vendor-B68RYDeC.js",
|
|
585
585
|
"index.html",
|
|
586
586
|
"_form-C-zZyKfB.js",
|
|
587
|
-
"_Pagination-
|
|
587
|
+
"_Pagination-C_ycPjHn.js"
|
|
588
588
|
]
|
|
589
589
|
},
|
|
590
590
|
"src/pages/control/WorkersPro.tsx": {
|
|
591
|
-
"file": "assets/WorkersPro-
|
|
591
|
+
"file": "assets/WorkersPro-DlHDhoV4.js",
|
|
592
592
|
"name": "WorkersPro",
|
|
593
593
|
"src": "src/pages/control/WorkersPro.tsx",
|
|
594
594
|
"isDynamicEntry": true,
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,l as n,r,t as i}from"./react-vendor-B68RYDeC.js";import{A as a,C as o,S as s,h as c,nt as l,rt as u,w as d}from"./index-BxYFC0LS.js";import{a as f,n as p,o as m,t as h}from"./form-C-zZyKfB.js";var g=e(t(),1),_=i(),v=e=>e==null?``:String(e);function y(){let{data:e}=a(()=>l.queues(),[],{intervalMs:3e4}),t=n().state?.clone,i=t?.options??{},[m,y]=(0,g.useState)(t?.queue??``),[x,ee]=(0,g.useState)(t?.dataText??`{
|
|
2
|
+
"hello": "world"
|
|
3
|
+
}`),[S,te]=(0,g.useState)(`1`),[C,ne]=(0,g.useState)(v(i.priority)),[w,re]=(0,g.useState)(``),[T,E]=(0,g.useState)(``),[D,ie]=(0,g.useState)(v(i.maxAttempts)),[O,k]=(0,g.useState)(v(typeof i.backoff==`number`?i.backoff:void 0)),[A,j]=(0,g.useState)(v(i.timeout)),[M,ae]=(0,g.useState)(``),[N,oe]=(0,g.useState)(i.removeOnComplete??!1),[P,se]=(0,g.useState)(i.removeOnFail??!1),[F,I]=(0,g.useState)(!1),[L,R]=(0,g.useState)(!1),[z,B]=(0,g.useState)(``),[V,H]=(0,g.useState)(``),[U,W]=(0,g.useState)(``),[G,ce]=(0,g.useState)(``),[K,le]=(0,g.useState)(``),[q,J]=(0,g.useState)(!1),[Y,X]=(0,g.useState)(null),[Z,Q]=(0,g.useState)(null),$=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},ue=async()=>{if(X(null),Q(null),!m.trim()){X({ok:!1,msg:`Choose a queue`});return}let e;try{e=JSON.parse(x)}catch(e){Q(`Invalid JSON: ${e.message}`);return}let t=$(w);if(T.trim()){let e=new Date(T).getTime();if(!Number.isFinite(e)){X({ok:!1,msg:`Run at is not a valid date/time`});return}t=Math.max(0,e-Date.now())}let n=$(O),r=n==null?void 0:z?{type:z,delay:n}:n,i=V.split(`,`).map(e=>e.trim()).filter(Boolean),a=G.split(`,`).map(e=>e.trim()).filter(Boolean),o={data:e,priority:$(C),delay:t,maxAttempts:$(D),backoff:r,timeout:$(A),jobId:M.trim()||void 0,removeOnComplete:N||void 0,removeOnFail:P||void 0,durable:F||void 0,lifo:L||void 0,tags:i.length?i:void 0,groupId:U.trim()||void 0,dependsOn:a.length?a:void 0,uniqueKey:K.trim()||void 0},s=$(S)??1;if(!Number.isInteger(s)||s<1){X({ok:!1,msg:`Count must be an integer of at least 1`});return}if(s>1e4){X({ok:!1,msg:`Count must be 10000 or fewer`});return}J(!0);try{if(s===1){let e=await l.addJob(m,o);X({ok:!0,msg:`Created job ${e.id}`}),u.success(`Job created`,`${m} · ${e.id}`)}else{let e=await l.addJobsBulk(m,Array.from({length:s},()=>o)),t=new Set(e.ids).size;X({ok:!0,msg:`Created ${t} job${t===1?``:`s`}`}),u.success(`Created ${t} job${t===1?``:`s`}`,`in ${m}`)}}catch(e){X({ok:!1,msg:e.message}),u.error(`Add job failed`,e.message)}finally{J(!1)}};return(0,_.jsxs)(`div`,{children:[(0,_.jsx)(c,{title:`Add Job`,description:`Enqueue a job with full options.`,actions:(0,_.jsx)(r,{to:`/jobs/bulk-add`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Bulk import`})}),t&&(0,_.jsx)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-accent/30 bg-accent/[0.06] px-4 py-2 text-sm text-accent`,children:`Pre-filled from an existing job. Review the data and options, then enqueue a fresh job.`}),(0,_.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),ue()},children:[(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{title:`Job`}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,_.jsxs)(h,{label:`Queue`,children:[(0,_.jsx)(p,{list:`queue-options`,value:m,onChange:e=>y(e.target.value),placeholder:`queue name (existing or new)`}),(0,_.jsx)(`datalist`,{id:`queue-options`,children:(e?.queues??[]).map(e=>(0,_.jsx)(`option`,{value:e.name},e.name))})]}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(h,{label:`Data (JSON)`,children:(0,_.jsx)(`textarea`,{value:x,onChange:e=>ee(e.target.value),onBlur:()=>{try{JSON.parse(x),Q(null)}catch(e){Q(`Invalid JSON: ${e.message}`)}},spellCheck:!1,rows:7,className:`w-full rounded-lg border border-line bg-surface-2 p-3 font-mono text-sm text-fg focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})}),Z&&(0,_.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:Z})]})]})]}),(0,_.jsxs)(s,{children:[(0,_.jsx)(o,{title:`Options`}),(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,_.jsx)(h,{label:`Priority`,children:(0,_.jsx)(p,{type:`number`,value:C,onChange:e=>ne(e.target.value),placeholder:`0`})}),(0,_.jsx)(h,{label:`Delay (ms)`,children:(0,_.jsx)(p,{type:`number`,min:0,value:w,onChange:e=>re(e.target.value),placeholder:`0`,disabled:T.trim()!==``})}),(0,_.jsx)(h,{label:`Run at`,hint:T.trim()?`Overrides Delay — derived from this time (local time).`:`(local time)`,children:(0,_.jsx)(p,{type:`datetime-local`,value:T,onChange:e=>E(e.target.value)})}),(0,_.jsx)(h,{label:`Max attempts`,hint:`blank = server default`,children:(0,_.jsx)(p,{type:`number`,min:1,value:D,onChange:e=>ie(e.target.value),placeholder:`3`})}),(0,_.jsx)(h,{label:`Backoff (ms)`,hint:`blank = server default`,children:(0,_.jsx)(p,{type:`number`,min:0,value:O,onChange:e=>k(e.target.value),placeholder:`1000`})}),(0,_.jsx)(h,{label:`Backoff strategy`,hint:`flat delay unless set`,children:(0,_.jsxs)(f,{value:z,onChange:e=>B(e.target.value),children:[(0,_.jsx)(`option`,{value:``,children:`flat`}),(0,_.jsx)(`option`,{value:`fixed`,children:`fixed`}),(0,_.jsx)(`option`,{value:`exponential`,children:`exponential`})]})}),(0,_.jsx)(h,{label:`Timeout (ms)`,children:(0,_.jsx)(p,{type:`number`,min:0,value:A,onChange:e=>j(e.target.value),placeholder:`—`})}),(0,_.jsx)(h,{label:`Custom job ID`,children:(0,_.jsx)(p,{value:M,onChange:e=>ae(e.target.value),placeholder:`idempotency key`})})]}),(0,_.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,_.jsx)(b,{label:`removeOnComplete`,checked:N,onChange:oe}),(0,_.jsx)(b,{label:`removeOnFail`,checked:P,onChange:se}),(0,_.jsx)(b,{label:`durable`,checked:F,onChange:I}),(0,_.jsx)(b,{label:`lifo`,checked:L,onChange:R})]}),(0,_.jsxs)(`div`,{className:`mt-4 border-t border-line pt-4`,children:[(0,_.jsx)(`div`,{className:`mb-3 text-[11px] uppercase tracking-wider text-faint`,children:`Advanced`}),(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,_.jsx)(h,{label:`Tags`,hint:`comma-separated`,children:(0,_.jsx)(p,{value:V,onChange:e=>H(e.target.value),placeholder:`email, urgent`})}),(0,_.jsx)(h,{label:`Group ID`,children:(0,_.jsx)(p,{value:U,onChange:e=>W(e.target.value),placeholder:`—`})}),(0,_.jsx)(h,{label:`Unique key`,hint:`dedup key`,children:(0,_.jsx)(p,{value:K,onChange:e=>le(e.target.value),placeholder:`—`})}),(0,_.jsx)(h,{label:`Depends on`,hint:`parent job ids, comma-separated`,children:(0,_.jsx)(p,{value:G,onChange:e=>ce(e.target.value),placeholder:`job-id-1, job-id-2`})})]})]})]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,_.jsx)(`div`,{className:`w-28`,children:(0,_.jsx)(h,{label:`Count`,hint:`1–10000`,children:(0,_.jsx)(p,{type:`number`,min:1,value:S,onChange:e=>te(e.target.value)})})}),(0,_.jsx)(d,{type:`submit`,variant:`accent`,disabled:q,children:q?`Adding…`:`Add job`}),Y&&(0,_.jsx)(`span`,{role:`status`,className:Y.ok?`text-sm text-success`:`text-sm text-danger`,children:Y.msg})]})]})]})}function b({label:e,checked:t,onChange:n}){return(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(m,{checked:t,onChange:n,label:e}),(0,_.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e})]})}export{y as AddJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{$ as r,N as i,Q as a,S as o,T as s,Y as c,at as l,h as u,it as d,u as f,v as p,w as m}from"./index-
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{$ as r,N as i,Q as a,S as o,T as s,Y as c,at as l,h as u,it as d,u as f,v as p,w as m}from"./index-BxYFC0LS.js";import{a as h,n as g,o as _,t as v}from"./form-C-zZyKfB.js";var y=e(t(),1),b=n(),x=[`email`,`webhook`,`slack`],S=Object.keys(d),C=[`>=`,`>`,`<=`,`<`],w={error_rate:{unit:`% (0–100)`,placeholder:`e.g. 5`},p99_latency:{unit:`ms`,placeholder:`e.g. 250`},waiting:{unit:`jobs`,placeholder:`e.g. 100`},failed:{unit:`jobs`,placeholder:`e.g. 10`},dlq:{unit:`jobs`,placeholder:`e.g. 1`}},T=`bunqueue OSS has no delivery backend — alerts fire as in-app toast + desktop notification only`;function E(){return typeof Notification>`u`?`unsupported`:Notification.permission}function D(){let{channels:e,rules:t,addChannel:n,removeChannel:h,addRule:g,removeRule:v,toggleRule:x}=l(),S=r(e=>e.breaching),[C,w]=(0,y.useState)(!1),[D,A]=(0,y.useState)(E);return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(u,{title:`Alerts`,description:`Threshold rules evaluated live in your browser.`,live:!0,actions:(0,b.jsxs)(b.Fragment,{children:[D===`granted`?(0,b.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm text-success`,children:[(0,b.jsx)(i,{className:`size-4`}),` Desktop alerts on`]}):D===`unsupported`?(0,b.jsx)(`span`,{className:`text-sm text-faint`,children:`Notifications unsupported`}):D===`denied`?(0,b.jsx)(`span`,{className:`text-sm text-faint`,children:`Desktop alerts blocked — allow notifications in browser settings`}):(0,b.jsx)(m,{size:`sm`,onClick:async()=>{A(await a())},children:`Enable desktop notifications`}),(0,b.jsx)(m,{variant:`accent`,size:`sm`,onClick:()=>w(e=>!e),children:`+ Create Alert Rule`})]})}),(0,b.jsx)(`div`,{className:`mb-6 rounded-lg border border-amber-500/20 bg-amber-500/5 px-4 py-3 text-sm text-amber-400/90`,children:`Rules are evaluated in this browser while a tab is open (even backgrounded), raising an in-app toast and — if enabled — a desktop notification. bunqueue OSS has no alerting backend, so email/webhook/slack delivery still needs your own monitoring or hosted bunqueue Cloud.`}),(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Triggered Alerts`}),S.length===0?(0,b.jsx)(p,{icon:(0,b.jsx)(i,{}),title:`No triggered alerts`,hint:t.some(e=>e.enabled)?`All enabled rules are within their thresholds.`:`No enabled rules yet. Create one below.`}):(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-danger/30 bg-red-500/5`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Rule`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Condition`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Current`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Since`})]})}),(0,b.jsx)(`tbody`,{children:S.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3 font-medium text-danger`,children:e.ruleName}),(0,b.jsxs)(`td`,{className:`px-5 py-3 text-muted`,children:[e.metricLabel,` `,e.operator,` `,(0,b.jsx)(`span`,{className:`font-semibold text-fg`,children:e.threshold})]}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.queue||`All queues`}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right tnum font-semibold text-danger`,children:Math.round(e.value*100)/100}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:f(e.at)})]},e.ruleId))})]})})]}),(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Notification Channels`}),(0,b.jsxs)(o,{children:[e.length===0?(0,b.jsx)(`p`,{className:`mb-4 text-sm text-faint`,children:`No channels yet. Add one below.`}):(0,b.jsx)(`ul`,{className:`mb-4 divide-y divide-line`,children:e.map(e=>(0,b.jsxs)(`li`,{className:`flex items-center justify-between py-2.5`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`text-sm font-medium capitalize text-fg`,children:e.type}),e.target?(0,b.jsx)(`div`,{className:`font-mono text-xs text-faint`,children:e.target}):(0,b.jsx)(`div`,{className:`text-xs italic text-warning`,children:`target not persisted (secret) — remove and re-add to restore it`})]}),(0,b.jsx)(s,{"aria-label":`Remove channel`,onClick:()=>h(e.id),children:(0,b.jsx)(c,{className:`size-3.5`})})]},e.id))}),(0,b.jsx)(O,{onAdd:n})]})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Alert Rules`}),C&&(0,b.jsx)(o,{className:`mb-4`,children:(0,b.jsx)(k,{onAdd:e=>{g(e),w(!1)}})}),t.length===0?(0,b.jsx)(p,{title:`No alert rules`,hint:`Create a rule to be notified when a threshold is crossed.`}):(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Rule`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Condition`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Channel`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{className:`w-12 px-5 py-3`})]})}),(0,b.jsx)(`tbody`,{children:t.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3 font-medium text-fg`,children:e.name}),(0,b.jsxs)(`td`,{className:`px-5 py-3 text-muted`,children:[d[e.metric],` `,e.operator,` `,(0,b.jsx)(`span`,{className:`font-semibold text-accent`,children:e.threshold})]}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.queue||`All queues`}),(0,b.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,b.jsx)(`span`,{className:`rounded-md bg-surface-2 px-2 py-0.5 text-xs capitalize text-muted`,children:e.channel}),(0,b.jsx)(`span`,{className:`ml-1.5 text-[10px] uppercase tracking-wider text-faint`,title:T,children:`not wired`})]}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(_,{checked:e.enabled,onChange:()=>x(e.id),label:`Enabled`})}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,b.jsx)(s,{"aria-label":`Delete rule`,onClick:()=>v(e.id),children:(0,b.jsx)(c,{className:`size-3.5`})})})]},e.id))})]})})]})]})}function O({onAdd:e}){let[t,n]=(0,y.useState)(`email`),[r,i]=(0,y.useState)(``);return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,b.jsx)(`div`,{className:`w-36`,children:(0,b.jsx)(v,{label:`Type`,children:(0,b.jsx)(h,{value:t,onChange:e=>n(e.target.value),children:x.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})})}),(0,b.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,b.jsx)(v,{label:t===`email`?`Email address`:`URL`,children:(0,b.jsx)(g,{value:r,onChange:e=>i(e.target.value),placeholder:t===`email`?`ops@example.com`:`https://hooks…`})})}),(0,b.jsx)(m,{variant:`accent`,disabled:!r,onClick:()=>{e(t,r),i(``)},children:`Add channel`})]})}function k({onAdd:e}){let[t,n]=(0,y.useState)(``),[r,i]=(0,y.useState)(`error_rate`),[a,o]=(0,y.useState)(`>=`),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(``),[f,p]=(0,y.useState)(`email`);return(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-6`,children:[(0,b.jsx)(v,{label:`Name`,children:(0,b.jsx)(g,{value:t,onChange:e=>n(e.target.value),placeholder:`High error rate`})}),(0,b.jsx)(v,{label:`Metric`,children:(0,b.jsx)(h,{value:r,onChange:e=>i(e.target.value),children:S.map(e=>(0,b.jsx)(`option`,{value:e,children:d[e]},e))})}),(0,b.jsx)(v,{label:`Operator`,children:(0,b.jsx)(h,{value:a,onChange:e=>o(e.target.value),children:C.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(v,{label:`Threshold`,hint:w[r].unit,children:(0,b.jsx)(g,{type:`number`,value:s,onChange:e=>c(e.target.value),placeholder:w[r].placeholder})}),(0,b.jsx)(v,{label:`Queue (optional)`,hint:r===`p99_latency`?`global only — latency is not per queue`:void 0,children:(0,b.jsx)(g,{value:l,onChange:e=>u(e.target.value),disabled:r===`p99_latency`,placeholder:r===`p99_latency`?`Global`:`All queues`,className:`disabled:cursor-not-allowed disabled:opacity-40`})}),(0,b.jsx)(v,{label:`Channel`,hint:`delivery not wired — in-app only`,children:(0,b.jsx)(h,{value:f,onChange:e=>p(e.target.value),children:x.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(`div`,{className:`col-span-full`,children:(0,b.jsx)(m,{variant:`accent`,disabled:!t||!s,onClick:()=>e({name:t,metric:r,operator:a,threshold:Number(s),queue:r===`p99_latency`?``:l,channel:f,enabled:!0}),children:`Save rule`})})]})}export{D as Alerts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{r as i}from"./connectionStore-B-hNUqwK.js";import{A as a,C as o,O as s,S as c,U as l,W as u,c as d,h as f,m as p,nt as m,r as h,s as g,w as _}from"./index-D9IOUE5C.js";import{i as v,n as y,o as b,t as x}from"./form-C-zZyKfB.js";import{t as S}from"./AreaChart-Dl_9G6GH.js";var C=e(n(),1),w={total:1e6,batch:5e3,producers:64,payload:65536,workers:64,workerBatch:1e3,processMs:6e4,durationS:600},T={queue:`benchmark`,mode:`count`,total:5e3,durationS:30,batch:100,producers:4,payload:128,workers:4,workerBatch:100,processMs:5,durable:!1,removeOnComplete:!0},E={Smoke:{mode:`count`,total:200,batch:50,producers:2,workers:1,workerBatch:50,processMs:0},Standard:{mode:`count`,total:5e3,batch:100,producers:4,workers:4,workerBatch:100,processMs:5},Stress:{mode:`count`,total:5e4,batch:500,producers:16,workers:16,workerBatch:200,processMs:0},Soak:{mode:`duration`,durationS:30,batch:100,producers:4,workers:8,workerBatch:100,processMs:10}},D=(e,t,n)=>Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t,O=(e,t)=>e.length?e[Math.min(e.length-1,Math.floor(t/100*e.length))]:0,k=(e,t,n,r,i)=>Array.from({length:t},(t,a)=>({data:{i:e+a,blob:n},durable:r,removeOnComplete:i})),A=e=>new Promise(t=>setTimeout(t,e)),j=async(e,t)=>{let n=performance.now()+e;for(;t()&&performance.now()<n;)await A(Math.min(100,Math.max(0,n-performance.now())))},M=e=>e instanceof Error?e.message:String(e),N=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`,P=r();function F({history:e,onClear:t}){if(!e.length)return null;let n=JSON.stringify(e,null,2);return(0,P.jsxs)(c,{padded:!1,className:`mt-6 overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Run history`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(s,{value:n}),(0,P.jsx)(_,{size:`sm`,variant:`ghost`,onClick:()=>{let e=new Blob([n],{type:`application/json`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`benchmark-history-${Date.now()}.json`,r.click(),URL.revokeObjectURL(t)},children:`Export JSON`}),(0,P.jsx)(_,{size:`sm`,variant:`ghost`,onClick:t,children:`Clear`})]})]}),(0,P.jsx)(`div`,{className:`overflow-x-auto`,children:(0,P.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,P.jsx)(`th`,{className:`px-5 py-2 font-medium`,children:`Mode`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Prod`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Wkr`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Pushed`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Push/s`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done/s`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`p95`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Dur`})]})}),(0,P.jsx)(`tbody`,{children:e.map(e=>(0,P.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,P.jsx)(`td`,{className:`px-5 py-2 capitalize text-muted`,children:e.mode}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.producers}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.workers}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-fg`,children:d(e.pushed)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:d(e.completed)}),(0,P.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-accent`,children:[N(e.pushPerSec),`/s`]}),(0,P.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:[N(e.donePerSec),`/s`]}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:g(e.p95)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:g(e.durationMs)})]},e.id))})]})})]})}var I={pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,elapsedMs:0,pushPerSec:0,donePerSec:0,activeWorkers:0,pushSeries:[],doneSeries:[],etaMs:null,error:null},L=()=>({pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,assigned:0,startedAt:0,pushLat:[],activeWorkers:0,error:null,lastAt:0,lastPushed:0,lastDone:0,pushSeries:[],doneSeries:[]}),R=0;function z(){let[e,t]=(0,C.useState)(`idle`),[n,r]=(0,C.useState)(I),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)([]),[c,l]=(0,C.useState)(null),u=(0,C.useRef)(!1),d=(0,C.useRef)(!1),f=(0,C.useRef)(!1),p=(0,C.useRef)(null),h=(0,C.useRef)(`idle`);h.current=e;let g=(0,C.useRef)(L());return(0,C.useEffect)(()=>()=>{u.current=!0},[]),(0,C.useEffect)(()=>{if(e!==`running`&&e!==`draining`)return;let t=setInterval(()=>{let e=g.current,t=performance.now(),n=t-e.startedAt,i=(t-e.lastAt)/1e3,a=i>0?Math.max(0,(e.pushed-e.lastPushed)/i):0,o=i>0?Math.max(0,(e.completed-e.lastDone)/i):0;e.lastAt=t,e.lastPushed=e.pushed,e.lastDone=e.completed,e.pushSeries=[...e.pushSeries,a].slice(-60),e.doneSeries=[...e.doneSeries,o].slice(-60);let s=null,c=p.current;if(c&&c.mode===`count`){let t=D(c.total,1,w.total);if(h.current===`draining`){let r=e.doneSeries.slice(-10),i=r.length?r.reduce((e,t)=>e+t,0)/r.length:0;i<=0&&n>0&&(i=e.completed/(n/1e3)),i>0&&(s=Math.max(0,t-e.completed)/i*1e3)}else a>0&&(s=Math.max(0,t-e.pushed)/a*1e3)}else c&&c.mode===`duration`&&(s=Math.max(0,D(c.durationS,1,w.durationS)*1e3-n));r({pushed:e.pushed,completed:e.completed,pushFailed:e.pushFailed,ackFailed:e.ackFailed,bytes:e.bytes,elapsedMs:n,pushPerSec:a,donePerSec:o,activeWorkers:e.activeWorkers,pushSeries:e.pushSeries,doneSeries:e.doneSeries,etaMs:s,error:e.error})},200);return()=>clearInterval(t)},[e]),{phase:e,live:n,summary:i,history:o,runCfg:c,run:async e=>{if(!d.current){d.current=!0;try{a(null);let n=e.queue.trim();if(!n){r({...I,error:`Queue name is required.`}),t(`error`);return}try{await m.overview()}catch(e){r({...I,error:`Server unreachable — start it on the Server page first. (${M(e)})`}),t(`error`);return}let i=D(e.total,1,w.total),o=D(e.durationS,1,w.durationS)*1e3,c=D(e.batch,1,w.batch),d=D(e.producers,e.mode===`duration`?0:1,w.producers),_=D(e.payload,0,w.payload),v=D(e.workers,0,w.workers),y=D(e.workerBatch,1,w.workerBatch),b=D(e.processMs,0,w.processMs);u.current=!1,f.current=!1,p.current=e,l(e),g.current=L(),g.current.startedAt=performance.now(),g.current.lastAt=performance.now(),r({...I}),t(`running`);let x=`x`.repeat(_),S=performance.now()+o,C=async()=>{for(;!u.current;){let t;if(e.mode===`count`){if(g.current.assigned>=i)break;t=Math.min(c,i-g.current.assigned)}else{if(performance.now()>=S)break;t=c}let r=g.current.assigned;g.current.assigned+=t;let a=k(r,t,x,e.durable,e.removeOnComplete),o=performance.now();try{await m.addJobsBulk(n,a),g.current.pushed+=t,g.current.bytes+=t*_}catch(e){g.current.pushFailed+=t,g.current.error??=M(e)}g.current.pushLat.push(performance.now()-o)}},T=async()=>{for(;!u.current&&!(e.mode===`duration`&&performance.now()>=S||e.mode===`count`&&g.current.completed>=i);){g.current.activeWorkers++;let t=[];try{try{t=(await m.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=M(e)}if(t.length>0){b>0&&await j(b,()=>!u.current);try{await m.ackBatch(t.map(e=>e.id)),g.current.completed+=t.length}catch(e){g.current.ackFailed+=t.length,g.current.error??=M(e)}}}finally{g.current.activeWorkers--}if(t.length===0){if(e.mode===`count`&&f.current)break;await A(50)}}},E=Array.from({length:d},C),N=Array.from({length:v},T),P=Promise.all(E).then(()=>{f.current=!0,!u.current&&e.mode===`count`&&v>0&&h.current===`running`&&t(`draining`)});await Promise.all([P,...N]);let F=g.current,z=performance.now()-F.startedAt,B=z/1e3||1,V=[...F.pushLat].sort((e,t)=>e-t),H={pushed:F.pushed,completed:F.completed,pushFailed:F.pushFailed,ackFailed:F.ackFailed,bytes:F.bytes,durationMs:z,pushPerSec:F.pushed/B,donePerSec:F.completed/B,mbPerSec:F.bytes/B,avg:V.length?V.reduce((e,t)=>e+t,0)/V.length:0,p50:O(V,50),p95:O(V,95),p99:O(V,99),max:V.length?V[V.length-1]:0,error:F.error};a(H),r(e=>({...e,pushed:F.pushed,completed:F.completed,elapsedMs:z,pushPerSec:0,donePerSec:0,activeWorkers:0,etaMs:0})),s(t=>[{...H,id:++R,at:Date.now(),mode:e.mode,producers:d,workers:v},...t].slice(0,12)),t(u.current?`stopped`:`done`)}finally{d.current=!1}}},stop:()=>{u.current=!0,(h.current===`running`||h.current===`draining`)&&t(`stopping`)},reset:()=>{u.current=!0,a(null),r(I),t(`idle`)},clearHistory:()=>s([])}}var B=[`count`,`duration`],V=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],H=e=>({...e,total:String(e.total),durationS:String(e.durationS),batch:String(e.batch),producers:String(e.producers),payload:String(e.payload),workers:String(e.workers),workerBatch:String(e.workerBatch),processMs:String(e.processMs)}),U=e=>({...e,total:Number(e.total),durationS:Number(e.durationS),batch:Number(e.batch),producers:Number(e.producers),payload:Number(e.payload),workers:Number(e.workers),workerBatch:Number(e.workerBatch),processMs:Number(e.processMs)});function W(){let[e,n]=(0,C.useState)(()=>H(T)),r=z(),{phase:s,live:O,summary:k,history:A}=r,j=s===`running`||s===`draining`||s===`stopping`,M=(e,t)=>n(n=>({...n,[e]:t})),I=e=>t=>M(e,t.target.value),L=e=>n(t=>{let n={...t};for(let[t,r]of Object.entries(e))n[t]=V.includes(t)?String(r):r;return n}),[R,W]=(0,C.useState)(T.queue);(0,C.useEffect)(()=>{let t=setTimeout(()=>W(e.queue.trim()||T.queue),400);return()=>clearTimeout(t)},[e.queue]);let{data:ee,error:te}=a(()=>m.counts(R),[R],{intervalMs:1e3}),q=ee?.counts??null,[J,Y]=(0,C.useState)(!1),[X,Z]=(0,C.useState)(null),ne=async()=>{let t=e.queue.trim();if(J||!t)return;let n=q&&R===t?` Currently ${d(q.waiting??0)} waiting / ${d(q.completed??0)} completed.`:``;if(window.confirm(`Remove benchmark jobs from "${t}"?${n}`)){Y(!0),Z(null);try{let e=null;for(let n of[`waiting`,`completed`,`failed`,`delayed`])try{await m.clean(t,{state:n,limit:w.total})}catch(t){e=t.message}let n=await m.counts(t).catch(t=>(e=t.message,null));Z(n==null?{error:e??`server unreachable — could not verify`}:{remaining:n.counts?.active??0})}finally{Y(!1)}}},Q=r.runCfg??U(e),$=D(Q.total,1,w.total),re=D(Q.workers,0,w.workers),ie=Q.mode===`count`&&(j||k)?Math.min(100,O.pushed/$*100):0,ae=Q.mode===`count`&&(j||k)?Math.min(100,O.completed/$*100):0,oe=Q.mode===`duration`?Math.min(100,O.elapsedMs/(D(Q.durationS,1,w.durationS)*1e3)*100):0,se=s===`running`?Q.mode===`duration`?`Running…`:`Producing…`:s===`draining`?`Draining…`:s===`stopping`?`Stopping…`:s===`error`?`Error`:k?`Result`:`Ready`,ce=(s===`running`||s===`draining`)&&O.etaMs!=null?O.etaMs>0?`ETA ${g(O.etaMs)}`:`finishing…`:s===`stopped`?`stopped early`:s===`done`?`complete`:``;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(f,{title:`Benchmark`,description:`Drive real load against the server — producers bulk-enqueue jobs while simulated workers pull, process and ack them. Throughput is measured client-side; the queue genuinely fills and drains.`,actions:s===`stopping`?(0,P.jsxs)(_,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,P.jsx)(l,{className:`size-3.5`}),` Stopping…`]}):j?(0,P.jsxs)(_,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,P.jsx)(l,{className:`size-3.5`}),` Stop`]}):(0,P.jsxs)(_,{variant:`success`,size:`sm`,onClick:()=>{let t=U(e),n=t.queue.trim()||T.queue;window.confirm(`Enqueue real jobs into "${n}" on ${i()}?`)&&r.run(t)},children:[(0,P.jsx)(u,{className:`size-3.5`}),` Run benchmark`]})}),O.error&&(0,P.jsx)(`div`,{className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:O.error}),(0,P.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-faint`,children:`Presets`}),Object.keys(E).map(e=>(0,P.jsx)(`button`,{type:`button`,disabled:j,onClick:()=>L(E[e]),className:`rounded-md border border-line bg-surface-2 px-2.5 py-1 text-xs text-muted transition-colors hover:border-line-strong hover:text-fg disabled:opacity-40`,children:e},e))]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,P.jsxs)(c,{className:`lg:col-span-1`,children:[(0,P.jsx)(o,{title:`Configuration`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(x,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,P.jsx)(y,{value:e.queue,disabled:j,onChange:e=>M(`queue`,e.target.value)})}),(0,P.jsx)(x,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,P.jsx)(v,{options:B,value:e.mode,onChange:e=>M(`mode`,e),disabled:j})}),e.mode===`count`?(0,P.jsx)(x,{label:`Total jobs`,hint:`max ${d(w.total)}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.total,value:e.total,disabled:j,onChange:I(`total`)})}):(0,P.jsx)(x,{label:`Duration (s)`,hint:`max ${w.durationS}s`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.durationS,value:e.durationS,disabled:j,onChange:I(`durationS`)})}),(0,P.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Producers`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,P.jsx)(x,{label:`Producers`,hint:`parallel, max ${w.producers}`,children:(0,P.jsx)(y,{type:`number`,min:e.mode===`duration`?0:1,max:w.producers,value:e.producers,disabled:j,onChange:I(`producers`)})}),(0,P.jsx)(x,{label:`Push batch`,hint:`jobs/req, max ${w.batch}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.batch,value:e.batch,disabled:j,onChange:I(`batch`)})}),(0,P.jsx)(x,{label:`Payload`,hint:`bytes/job, max ${d(w.payload)}`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.payload,value:e.payload,disabled:j,onChange:I(`payload`)})})]}),(0,P.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Workers (simulated)`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,P.jsx)(x,{label:`Workers`,hint:`0 = produce only, max ${w.workers}`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.workers,value:e.workers,disabled:j,onChange:I(`workers`)})}),(0,P.jsx)(x,{label:`Pull batch`,hint:`jobs/pull, max ${w.workerBatch}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.workerBatch,value:e.workerBatch,disabled:j,onChange:I(`workerBatch`)})}),(0,P.jsx)(x,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.processMs,value:e.processMs,disabled:j,onChange:I(`processMs`)})})]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,P.jsx)(b,{checked:e.durable,onChange:e=>M(`durable`,e),disabled:j}),(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:`Durable (fsync each job)`})]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,P.jsx)(b,{checked:e.removeOnComplete,onChange:e=>M(`removeOnComplete`,e),disabled:j}),(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:`Remove on complete`})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[(0,P.jsx)(_,{variant:`ghost`,size:`sm`,disabled:j||J,onClick:ne,children:J?`Cleaning…`:`Clean queue`}),X&&(`error`in X?(0,P.jsxs)(`span`,{className:`text-xs text-danger`,children:[`Clean unverified — `,X.error]}):(0,P.jsx)(`span`,{className:t(`text-xs`,X.remaining>0?`text-warning`:`text-success`),children:X.remaining>0?`Cleaned — ${d(X.remaining)} active job(s) remain (requeued after the stall timeout)`:`Cleaned — 0 jobs remain`}))]})]})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,P.jsxs)(c,{children:[(0,P.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:se}),(0,P.jsx)(`span`,{className:`text-xs text-faint`,children:ce})]}),(0,P.jsx)(G,{label:Q.mode===`duration`?`Elapsed`:`Produced`,pct:Q.mode===`duration`?oe:ie,tone:`accent`}),re>0&&Q.mode===`count`&&(0,P.jsx)(G,{label:`Completed`,pct:ae,tone:`emerald`}),(0,P.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,P.jsx)(p,{label:`Pushed`,value:d(O.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(O.completed),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Push/sec`,value:N(O.pushPerSec),compact:!0}),(0,P.jsx)(p,{label:`Done/sec`,value:N(O.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Elapsed`,value:g(O.elapsedMs),compact:!0}),(0,P.jsx)(p,{label:`Active workers`,value:`${O.activeWorkers}/${re}`,tone:`blue`,compact:!0}),(0,P.jsx)(p,{label:`Data`,value:h(k?.bytes??O.bytes),compact:!0}),(0,P.jsx)(p,{label:`Errors`,value:d((k?.pushFailed??O.pushFailed)+(k?.ackFailed??O.ackFailed)),tone:O.pushFailed+O.ackFailed?`red`:`default`,compact:!0})]})]}),(0,P.jsxs)(c,{children:[(0,P.jsx)(o,{title:`Throughput`}),(0,P.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Enqueue (client → server) vs completion (workers) per second`}),(0,P.jsx)(S,{series:[{label:`Push/sec`,color:`#38bdf8`,points:O.pushSeries,area:!0},{label:`Done/sec`,color:`#34d399`,points:O.doneSeries,area:!0}]}),(0,P.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,P.jsx)(K,{color:`#38bdf8`,label:`Push/sec`,value:O.pushPerSec}),(0,P.jsx)(K,{color:`#34d399`,label:`Done/sec`,value:O.donePerSec})]})]})]})]}),k&&(0,P.jsxs)(c,{className:`mt-6`,children:[(0,P.jsx)(o,{title:`Summary`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4 xl:grid-cols-8`,children:[(0,P.jsx)(p,{label:`Pushed`,value:d(k.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(k.completed),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Duration`,value:g(k.durationMs),compact:!0}),(0,P.jsx)(p,{label:`Avg push/s`,value:N(k.pushPerSec),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Avg done/s`,value:N(k.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Data rate`,value:`${h(k.mbPerSec)}/s`,compact:!0}),(0,P.jsx)(p,{label:`Push p95`,value:g(k.p95),compact:!0}),(0,P.jsx)(p,{label:`Push p99`,value:g(k.p99),compact:!0})]}),(0,P.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,g(k.avg),` · p50 `,g(k.p50),` · p95`,` `,g(k.p95),` · p99 `,g(k.p99),` · max `,g(k.max),`.`,k.error?` First error: ${k.error}`:``]})]}),(0,P.jsxs)(c,{className:`mt-6`,children:[(0,P.jsx)(o,{title:`Server queue: ${R}`,action:te?(0,P.jsx)(`span`,{className:`text-xs font-medium text-warning`,children:`stale — server unreachable`}):void 0}),(0,P.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Live counts from the server (poll 1s).`}),q?(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,P.jsx)(p,{label:`Waiting`,value:d(q.waiting??0),tone:`amber`,compact:!0}),(0,P.jsx)(p,{label:`Active`,value:d(q.active??0),tone:`blue`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(q.completed??0),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Failed`,value:d(q.failed??0),tone:q.failed?`red`:`default`,compact:!0}),(0,P.jsx)(p,{label:`Delayed`,value:d(q.delayed??0),compact:!0})]}):(0,P.jsx)(`p`,{className:`text-sm text-faint`,children:`No counts yet — waiting for the server to answer for this queue.`})]}),(0,P.jsx)(F,{history:A,onClear:r.clearHistory})]})}function G({label:e,pct:n,tone:r}){return(0,P.jsxs)(`div`,{className:`mb-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] text-faint`,children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsxs)(`span`,{className:`tnum`,children:[n.toFixed(0),`%`]})]}),(0,P.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,P.jsx)(`div`,{className:t(`h-full rounded-full transition-all`,r===`accent`?`bg-accent`:`bg-emerald-500`),style:{width:`${n}%`}})})]})}function K({color:e,label:t,value:n}){return(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,P.jsxs)(`span`,{className:`text-fg`,children:[N(n),`/s`]})]})}export{W as Benchmark};
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{r as i}from"./connectionStore-B-hNUqwK.js";import{A as a,C as o,O as s,S as c,U as l,W as u,c as d,h as f,m as p,nt as m,r as h,s as g,w as _}from"./index-BxYFC0LS.js";import{i as v,n as y,o as b,t as x}from"./form-C-zZyKfB.js";import{t as S}from"./AreaChart-Dl_9G6GH.js";var C=e(n(),1),w={total:1e6,batch:5e3,producers:64,payload:65536,workers:64,workerBatch:1e3,processMs:6e4,durationS:600},T={queue:`benchmark`,mode:`count`,total:5e3,durationS:30,batch:100,producers:4,payload:128,workers:4,workerBatch:100,processMs:5,durable:!1,removeOnComplete:!0},E={Smoke:{mode:`count`,total:200,batch:50,producers:2,workers:1,workerBatch:50,processMs:0},Standard:{mode:`count`,total:5e3,batch:100,producers:4,workers:4,workerBatch:100,processMs:5},Stress:{mode:`count`,total:5e4,batch:500,producers:16,workers:16,workerBatch:200,processMs:0},Soak:{mode:`duration`,durationS:30,batch:100,producers:4,workers:8,workerBatch:100,processMs:10}},D=(e,t,n)=>Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t,O=(e,t)=>e.length?e[Math.min(e.length-1,Math.floor(t/100*e.length))]:0,k=(e,t,n,r,i)=>Array.from({length:t},(t,a)=>({data:{i:e+a,blob:n},durable:r,removeOnComplete:i})),A=e=>new Promise(t=>setTimeout(t,e)),j=async(e,t)=>{let n=performance.now()+e;for(;t()&&performance.now()<n;)await A(Math.min(100,Math.max(0,n-performance.now())))},M=e=>e instanceof Error?e.message:String(e),N=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`,P=r();function F({history:e,onClear:t}){if(!e.length)return null;let n=JSON.stringify(e,null,2);return(0,P.jsxs)(c,{padded:!1,className:`mt-6 overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Run history`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(s,{value:n}),(0,P.jsx)(_,{size:`sm`,variant:`ghost`,onClick:()=>{let e=new Blob([n],{type:`application/json`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`benchmark-history-${Date.now()}.json`,r.click(),URL.revokeObjectURL(t)},children:`Export JSON`}),(0,P.jsx)(_,{size:`sm`,variant:`ghost`,onClick:t,children:`Clear`})]})]}),(0,P.jsx)(`div`,{className:`overflow-x-auto`,children:(0,P.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,P.jsx)(`th`,{className:`px-5 py-2 font-medium`,children:`Mode`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Prod`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Wkr`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Pushed`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Push/s`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done/s`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`p95`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Dur`})]})}),(0,P.jsx)(`tbody`,{children:e.map(e=>(0,P.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,P.jsx)(`td`,{className:`px-5 py-2 capitalize text-muted`,children:e.mode}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.producers}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.workers}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-fg`,children:d(e.pushed)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:d(e.completed)}),(0,P.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-accent`,children:[N(e.pushPerSec),`/s`]}),(0,P.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:[N(e.donePerSec),`/s`]}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:g(e.p95)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:g(e.durationMs)})]},e.id))})]})})]})}var I={pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,elapsedMs:0,pushPerSec:0,donePerSec:0,activeWorkers:0,pushSeries:[],doneSeries:[],etaMs:null,error:null},L=()=>({pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,assigned:0,startedAt:0,pushLat:[],activeWorkers:0,error:null,lastAt:0,lastPushed:0,lastDone:0,pushSeries:[],doneSeries:[]}),R=0;function z(){let[e,t]=(0,C.useState)(`idle`),[n,r]=(0,C.useState)(I),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)([]),[c,l]=(0,C.useState)(null),u=(0,C.useRef)(!1),d=(0,C.useRef)(!1),f=(0,C.useRef)(!1),p=(0,C.useRef)(null),h=(0,C.useRef)(`idle`);h.current=e;let g=(0,C.useRef)(L());return(0,C.useEffect)(()=>()=>{u.current=!0},[]),(0,C.useEffect)(()=>{if(e!==`running`&&e!==`draining`)return;let t=setInterval(()=>{let e=g.current,t=performance.now(),n=t-e.startedAt,i=(t-e.lastAt)/1e3,a=i>0?Math.max(0,(e.pushed-e.lastPushed)/i):0,o=i>0?Math.max(0,(e.completed-e.lastDone)/i):0;e.lastAt=t,e.lastPushed=e.pushed,e.lastDone=e.completed,e.pushSeries=[...e.pushSeries,a].slice(-60),e.doneSeries=[...e.doneSeries,o].slice(-60);let s=null,c=p.current;if(c&&c.mode===`count`){let t=D(c.total,1,w.total);if(h.current===`draining`){let r=e.doneSeries.slice(-10),i=r.length?r.reduce((e,t)=>e+t,0)/r.length:0;i<=0&&n>0&&(i=e.completed/(n/1e3)),i>0&&(s=Math.max(0,t-e.completed)/i*1e3)}else a>0&&(s=Math.max(0,t-e.pushed)/a*1e3)}else c&&c.mode===`duration`&&(s=Math.max(0,D(c.durationS,1,w.durationS)*1e3-n));r({pushed:e.pushed,completed:e.completed,pushFailed:e.pushFailed,ackFailed:e.ackFailed,bytes:e.bytes,elapsedMs:n,pushPerSec:a,donePerSec:o,activeWorkers:e.activeWorkers,pushSeries:e.pushSeries,doneSeries:e.doneSeries,etaMs:s,error:e.error})},200);return()=>clearInterval(t)},[e]),{phase:e,live:n,summary:i,history:o,runCfg:c,run:async e=>{if(!d.current){d.current=!0;try{a(null);let n=e.queue.trim();if(!n){r({...I,error:`Queue name is required.`}),t(`error`);return}try{await m.overview()}catch(e){r({...I,error:`Server unreachable — start it on the Server page first. (${M(e)})`}),t(`error`);return}let i=D(e.total,1,w.total),o=D(e.durationS,1,w.durationS)*1e3,c=D(e.batch,1,w.batch),d=D(e.producers,e.mode===`duration`?0:1,w.producers),_=D(e.payload,0,w.payload),v=D(e.workers,0,w.workers),y=D(e.workerBatch,1,w.workerBatch),b=D(e.processMs,0,w.processMs);u.current=!1,f.current=!1,p.current=e,l(e),g.current=L(),g.current.startedAt=performance.now(),g.current.lastAt=performance.now(),r({...I}),t(`running`);let x=`x`.repeat(_),S=performance.now()+o,C=async()=>{for(;!u.current;){let t;if(e.mode===`count`){if(g.current.assigned>=i)break;t=Math.min(c,i-g.current.assigned)}else{if(performance.now()>=S)break;t=c}let r=g.current.assigned;g.current.assigned+=t;let a=k(r,t,x,e.durable,e.removeOnComplete),o=performance.now();try{await m.addJobsBulk(n,a),g.current.pushed+=t,g.current.bytes+=t*_}catch(e){g.current.pushFailed+=t,g.current.error??=M(e)}g.current.pushLat.push(performance.now()-o)}},T=async()=>{for(;!u.current&&!(e.mode===`duration`&&performance.now()>=S||e.mode===`count`&&g.current.completed>=i);){g.current.activeWorkers++;let t=[];try{try{t=(await m.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=M(e)}if(t.length>0){b>0&&await j(b,()=>!u.current);try{await m.ackBatch(t.map(e=>e.id)),g.current.completed+=t.length}catch(e){g.current.ackFailed+=t.length,g.current.error??=M(e)}}}finally{g.current.activeWorkers--}if(t.length===0){if(e.mode===`count`&&f.current)break;await A(50)}}},E=Array.from({length:d},C),N=Array.from({length:v},T),P=Promise.all(E).then(()=>{f.current=!0,!u.current&&e.mode===`count`&&v>0&&h.current===`running`&&t(`draining`)});await Promise.all([P,...N]);let F=g.current,z=performance.now()-F.startedAt,B=z/1e3||1,V=[...F.pushLat].sort((e,t)=>e-t),H={pushed:F.pushed,completed:F.completed,pushFailed:F.pushFailed,ackFailed:F.ackFailed,bytes:F.bytes,durationMs:z,pushPerSec:F.pushed/B,donePerSec:F.completed/B,mbPerSec:F.bytes/B,avg:V.length?V.reduce((e,t)=>e+t,0)/V.length:0,p50:O(V,50),p95:O(V,95),p99:O(V,99),max:V.length?V[V.length-1]:0,error:F.error};a(H),r(e=>({...e,pushed:F.pushed,completed:F.completed,elapsedMs:z,pushPerSec:0,donePerSec:0,activeWorkers:0,etaMs:0})),s(t=>[{...H,id:++R,at:Date.now(),mode:e.mode,producers:d,workers:v},...t].slice(0,12)),t(u.current?`stopped`:`done`)}finally{d.current=!1}}},stop:()=>{u.current=!0,(h.current===`running`||h.current===`draining`)&&t(`stopping`)},reset:()=>{u.current=!0,a(null),r(I),t(`idle`)},clearHistory:()=>s([])}}var B=[`count`,`duration`],V=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],H=e=>({...e,total:String(e.total),durationS:String(e.durationS),batch:String(e.batch),producers:String(e.producers),payload:String(e.payload),workers:String(e.workers),workerBatch:String(e.workerBatch),processMs:String(e.processMs)}),U=e=>({...e,total:Number(e.total),durationS:Number(e.durationS),batch:Number(e.batch),producers:Number(e.producers),payload:Number(e.payload),workers:Number(e.workers),workerBatch:Number(e.workerBatch),processMs:Number(e.processMs)});function W(){let[e,n]=(0,C.useState)(()=>H(T)),r=z(),{phase:s,live:O,summary:k,history:A}=r,j=s===`running`||s===`draining`||s===`stopping`,M=(e,t)=>n(n=>({...n,[e]:t})),I=e=>t=>M(e,t.target.value),L=e=>n(t=>{let n={...t};for(let[t,r]of Object.entries(e))n[t]=V.includes(t)?String(r):r;return n}),[R,W]=(0,C.useState)(T.queue);(0,C.useEffect)(()=>{let t=setTimeout(()=>W(e.queue.trim()||T.queue),400);return()=>clearTimeout(t)},[e.queue]);let{data:ee,error:te}=a(()=>m.counts(R),[R],{intervalMs:1e3}),q=ee?.counts??null,[J,Y]=(0,C.useState)(!1),[X,Z]=(0,C.useState)(null),ne=async()=>{let t=e.queue.trim();if(J||!t)return;let n=q&&R===t?` Currently ${d(q.waiting??0)} waiting / ${d(q.completed??0)} completed.`:``;if(window.confirm(`Remove benchmark jobs from "${t}"?${n}`)){Y(!0),Z(null);try{let e=null;for(let n of[`waiting`,`completed`,`failed`,`delayed`])try{await m.clean(t,{state:n,limit:w.total})}catch(t){e=t.message}let n=await m.counts(t).catch(t=>(e=t.message,null));Z(n==null?{error:e??`server unreachable — could not verify`}:{remaining:n.counts?.active??0})}finally{Y(!1)}}},Q=r.runCfg??U(e),$=D(Q.total,1,w.total),re=D(Q.workers,0,w.workers),ie=Q.mode===`count`&&(j||k)?Math.min(100,O.pushed/$*100):0,ae=Q.mode===`count`&&(j||k)?Math.min(100,O.completed/$*100):0,oe=Q.mode===`duration`?Math.min(100,O.elapsedMs/(D(Q.durationS,1,w.durationS)*1e3)*100):0,se=s===`running`?Q.mode===`duration`?`Running…`:`Producing…`:s===`draining`?`Draining…`:s===`stopping`?`Stopping…`:s===`error`?`Error`:k?`Result`:`Ready`,ce=(s===`running`||s===`draining`)&&O.etaMs!=null?O.etaMs>0?`ETA ${g(O.etaMs)}`:`finishing…`:s===`stopped`?`stopped early`:s===`done`?`complete`:``;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(f,{title:`Benchmark`,description:`Drive real load against the server — producers bulk-enqueue jobs while simulated workers pull, process and ack them. Throughput is measured client-side; the queue genuinely fills and drains.`,actions:s===`stopping`?(0,P.jsxs)(_,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,P.jsx)(l,{className:`size-3.5`}),` Stopping…`]}):j?(0,P.jsxs)(_,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,P.jsx)(l,{className:`size-3.5`}),` Stop`]}):(0,P.jsxs)(_,{variant:`success`,size:`sm`,onClick:()=>{let t=U(e),n=t.queue.trim()||T.queue;window.confirm(`Enqueue real jobs into "${n}" on ${i()}?`)&&r.run(t)},children:[(0,P.jsx)(u,{className:`size-3.5`}),` Run benchmark`]})}),O.error&&(0,P.jsx)(`div`,{className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:O.error}),(0,P.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-faint`,children:`Presets`}),Object.keys(E).map(e=>(0,P.jsx)(`button`,{type:`button`,disabled:j,onClick:()=>L(E[e]),className:`rounded-md border border-line bg-surface-2 px-2.5 py-1 text-xs text-muted transition-colors hover:border-line-strong hover:text-fg disabled:opacity-40`,children:e},e))]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,P.jsxs)(c,{className:`lg:col-span-1`,children:[(0,P.jsx)(o,{title:`Configuration`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(x,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,P.jsx)(y,{value:e.queue,disabled:j,onChange:e=>M(`queue`,e.target.value)})}),(0,P.jsx)(x,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,P.jsx)(v,{options:B,value:e.mode,onChange:e=>M(`mode`,e),disabled:j})}),e.mode===`count`?(0,P.jsx)(x,{label:`Total jobs`,hint:`max ${d(w.total)}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.total,value:e.total,disabled:j,onChange:I(`total`)})}):(0,P.jsx)(x,{label:`Duration (s)`,hint:`max ${w.durationS}s`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.durationS,value:e.durationS,disabled:j,onChange:I(`durationS`)})}),(0,P.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Producers`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,P.jsx)(x,{label:`Producers`,hint:`parallel, max ${w.producers}`,children:(0,P.jsx)(y,{type:`number`,min:e.mode===`duration`?0:1,max:w.producers,value:e.producers,disabled:j,onChange:I(`producers`)})}),(0,P.jsx)(x,{label:`Push batch`,hint:`jobs/req, max ${w.batch}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.batch,value:e.batch,disabled:j,onChange:I(`batch`)})}),(0,P.jsx)(x,{label:`Payload`,hint:`bytes/job, max ${d(w.payload)}`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.payload,value:e.payload,disabled:j,onChange:I(`payload`)})})]}),(0,P.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Workers (simulated)`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,P.jsx)(x,{label:`Workers`,hint:`0 = produce only, max ${w.workers}`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.workers,value:e.workers,disabled:j,onChange:I(`workers`)})}),(0,P.jsx)(x,{label:`Pull batch`,hint:`jobs/pull, max ${w.workerBatch}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.workerBatch,value:e.workerBatch,disabled:j,onChange:I(`workerBatch`)})}),(0,P.jsx)(x,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.processMs,value:e.processMs,disabled:j,onChange:I(`processMs`)})})]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,P.jsx)(b,{checked:e.durable,onChange:e=>M(`durable`,e),disabled:j}),(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:`Durable (fsync each job)`})]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,P.jsx)(b,{checked:e.removeOnComplete,onChange:e=>M(`removeOnComplete`,e),disabled:j}),(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:`Remove on complete`})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[(0,P.jsx)(_,{variant:`ghost`,size:`sm`,disabled:j||J,onClick:ne,children:J?`Cleaning…`:`Clean queue`}),X&&(`error`in X?(0,P.jsxs)(`span`,{className:`text-xs text-danger`,children:[`Clean unverified — `,X.error]}):(0,P.jsx)(`span`,{className:t(`text-xs`,X.remaining>0?`text-warning`:`text-success`),children:X.remaining>0?`Cleaned — ${d(X.remaining)} active job(s) remain (requeued after the stall timeout)`:`Cleaned — 0 jobs remain`}))]})]})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,P.jsxs)(c,{children:[(0,P.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:se}),(0,P.jsx)(`span`,{className:`text-xs text-faint`,children:ce})]}),(0,P.jsx)(G,{label:Q.mode===`duration`?`Elapsed`:`Produced`,pct:Q.mode===`duration`?oe:ie,tone:`accent`}),re>0&&Q.mode===`count`&&(0,P.jsx)(G,{label:`Completed`,pct:ae,tone:`emerald`}),(0,P.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,P.jsx)(p,{label:`Pushed`,value:d(O.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(O.completed),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Push/sec`,value:N(O.pushPerSec),compact:!0}),(0,P.jsx)(p,{label:`Done/sec`,value:N(O.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Elapsed`,value:g(O.elapsedMs),compact:!0}),(0,P.jsx)(p,{label:`Active workers`,value:`${O.activeWorkers}/${re}`,tone:`blue`,compact:!0}),(0,P.jsx)(p,{label:`Data`,value:h(k?.bytes??O.bytes),compact:!0}),(0,P.jsx)(p,{label:`Errors`,value:d((k?.pushFailed??O.pushFailed)+(k?.ackFailed??O.ackFailed)),tone:O.pushFailed+O.ackFailed?`red`:`default`,compact:!0})]})]}),(0,P.jsxs)(c,{children:[(0,P.jsx)(o,{title:`Throughput`}),(0,P.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Enqueue (client → server) vs completion (workers) per second`}),(0,P.jsx)(S,{series:[{label:`Push/sec`,color:`#38bdf8`,points:O.pushSeries,area:!0},{label:`Done/sec`,color:`#34d399`,points:O.doneSeries,area:!0}]}),(0,P.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,P.jsx)(K,{color:`#38bdf8`,label:`Push/sec`,value:O.pushPerSec}),(0,P.jsx)(K,{color:`#34d399`,label:`Done/sec`,value:O.donePerSec})]})]})]})]}),k&&(0,P.jsxs)(c,{className:`mt-6`,children:[(0,P.jsx)(o,{title:`Summary`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4 xl:grid-cols-8`,children:[(0,P.jsx)(p,{label:`Pushed`,value:d(k.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(k.completed),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Duration`,value:g(k.durationMs),compact:!0}),(0,P.jsx)(p,{label:`Avg push/s`,value:N(k.pushPerSec),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Avg done/s`,value:N(k.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Data rate`,value:`${h(k.mbPerSec)}/s`,compact:!0}),(0,P.jsx)(p,{label:`Push p95`,value:g(k.p95),compact:!0}),(0,P.jsx)(p,{label:`Push p99`,value:g(k.p99),compact:!0})]}),(0,P.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,g(k.avg),` · p50 `,g(k.p50),` · p95`,` `,g(k.p95),` · p99 `,g(k.p99),` · max `,g(k.max),`.`,k.error?` First error: ${k.error}`:``]})]}),(0,P.jsxs)(c,{className:`mt-6`,children:[(0,P.jsx)(o,{title:`Server queue: ${R}`,action:te?(0,P.jsx)(`span`,{className:`text-xs font-medium text-warning`,children:`stale — server unreachable`}):void 0}),(0,P.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Live counts from the server (poll 1s).`}),q?(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,P.jsx)(p,{label:`Waiting`,value:d(q.waiting??0),tone:`amber`,compact:!0}),(0,P.jsx)(p,{label:`Active`,value:d(q.active??0),tone:`blue`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(q.completed??0),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Failed`,value:d(q.failed??0),tone:q.failed?`red`:`default`,compact:!0}),(0,P.jsx)(p,{label:`Delayed`,value:d(q.delayed??0),compact:!0})]}):(0,P.jsx)(`p`,{className:`text-sm text-faint`,children:`No counts yet — waiting for the server to answer for this queue.`})]}),(0,P.jsx)(F,{history:A,onClear:r.clearHistory})]})}function G({label:e,pct:n,tone:r}){return(0,P.jsxs)(`div`,{className:`mb-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] text-faint`,children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsxs)(`span`,{className:`tnum`,children:[n.toFixed(0),`%`]})]}),(0,P.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,P.jsx)(`div`,{className:t(`h-full rounded-full transition-all`,r===`accent`?`bg-accent`:`bg-emerald-500`),style:{width:`${n}%`}})})]})}function K({color:e,label:t,value:n}){return(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,P.jsxs)(`span`,{className:`text-fg`,children:[N(n),`/s`]})]})}export{W as Benchmark};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{A as r,C as i,S as a,h as o,nt as s,rt as c,w as l}from"./index-
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{A as r,C as i,S as a,h as o,nt as s,rt as c,w as l}from"./index-BxYFC0LS.js";import{i as u,n as d,t as f}from"./form-C-zZyKfB.js";var p=e(t(),1),m=n(),h=1e4,g=`[
|
|
2
2
|
{ "data": { "to": "a@example.com", "template": "welcome" }, "priority": 1 },
|
|
3
3
|
{ "data": { "to": "b@example.com", "template": "welcome" } }
|
|
4
4
|
]`,_=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},v=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,y=e=>typeof e==`boolean`?e:void 0,b=e=>typeof e==`string`&&e!==``?e:void 0;function x(e,t,n){if(n===`spec`&&e&&typeof e==`object`&&!Array.isArray(e)&&`data`in e){let n=e;return{data:n.data,priority:v(n.priority)??t.priority,delay:v(n.delay),maxAttempts:v(n.maxAttempts)??t.maxAttempts,backoff:v(n.backoff)??t.backoff,timeout:v(n.timeout)??t.timeout,jobId:b(n.jobId),removeOnComplete:y(n.removeOnComplete),removeOnFail:y(n.removeOnFail),durable:y(n.durable),lifo:y(n.lifo),ttl:v(n.ttl),uniqueKey:b(n.uniqueKey)}}return{data:e,...t}}var S=new Set([`data`,`priority`,`delay`,`maxAttempts`,`backoff`,`timeout`,`jobId`,`removeOnComplete`,`removeOnFail`,`durable`,`lifo`,`ttl`,`uniqueKey`]);function C(e){return e.some(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`data`in e&&Object.keys(e).some(e=>!S.has(e)))}function w(e){let t=e.trim();if(!t)return{items:[],error:null};try{let e=JSON.parse(t);return Array.isArray(e)?{items:e,error:null}:{items:[e],error:null}}catch{}let n=[],r=t.split(`
|