bunqueue-dashboard 0.0.25 → 0.0.26
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 +71 -71
- package/dist/assets/{AddJob-D9r_ckWp.js → AddJob-B6DB3nLS.js} +1 -1
- package/dist/assets/{Alerts-D5HU-0Dx.js → Alerts-CWgn7JKK.js} +1 -1
- package/dist/assets/{Benchmark-CYC3PIii.js → Benchmark-C6eJlf21.js} +1 -1
- package/dist/assets/{BulkAddJobs-BFjzY7tK.js → BulkAddJobs-D5A-56qh.js} +1 -1
- package/dist/assets/{CopilotPanel-CZCHTE8m.js → CopilotPanel-C4u8nJMr.js} +1 -1
- package/dist/assets/{CopyButton-fN1FbSIy.js → CopyButton-B2gM7BeT.js} +1 -1
- package/dist/assets/{Cron-BhZGb_DH.js → Cron-D8Cl1VQg.js} +1 -1
- package/dist/assets/{CronManager-CU9_cil9.js → CronManager-DkpnKkUk.js} +1 -1
- package/dist/assets/{Database-DYlWeDIA.js → Database-BmdixnFB.js} +1 -1
- package/dist/assets/{Diagnostics-BAfmoJ0e.js → Diagnostics-DNCcEQZe.js} +1 -1
- package/dist/assets/{Dlq-BPUAPLUg.js → Dlq-ChFKsJwc.js} +1 -1
- package/dist/assets/{DlqControl-BjeqsueE.js → DlqControl-C0RX-JRF.js} +1 -1
- package/dist/assets/{DlqPro-vuL9h-Ab.js → DlqPro-CkDrvA_m.js} +1 -1
- package/dist/assets/{Flows-Czq_GBW2.js → Flows-tVpaOy-A.js} +1 -1
- package/dist/assets/{JobInspector-BMi76I46.js → JobInspector-B6RmHnFF.js} +1 -1
- package/dist/assets/{Jobs-I66fxS_x.js → Jobs-CBoU-CeR.js} +1 -1
- package/dist/assets/{JobsPro-CNgYYpHP.js → JobsPro-WiZ3UHGN.js} +1 -1
- package/dist/assets/{Logs-QacZ07Ig.js → Logs-BWq4h_tj.js} +1 -1
- package/dist/assets/{LogsPro-BK6dIfm_.js → LogsPro-Bf9Ihrkj.js} +1 -1
- package/dist/assets/{McpServer-DCTEyxfJ.js → McpServer-DZD7-dyS.js} +1 -1
- package/dist/assets/{Metrics-Bo_LGDpq.js → Metrics-Cu1CHLHF.js} +1 -1
- package/dist/assets/{MetricsPro-mUantDrK.js → MetricsPro-Bs-Rwic_.js} +1 -1
- package/dist/assets/{Overview-DRa8YOXL.js → Overview-BSqH2VRL.js} +1 -1
- package/dist/assets/{Pagination-ByLXrTJL.js → Pagination-C-6yLcP3.js} +1 -1
- package/dist/assets/{QueueActions-CPo6RJsA.js → QueueActions-Dhy0KXjr.js} +1 -1
- package/dist/assets/{QueueControl-DnGbiwVj.js → QueueControl-2x3FDkR9.js} +1 -1
- package/dist/assets/{QueueDetail-BZQkagxC.js → QueueDetail-Nfc8Zu5b.js} +1 -1
- package/dist/assets/{QueueDetailPro-C2faHlWj.js → QueueDetailPro-CnuNbKyk.js} +1 -1
- package/dist/assets/{Queues-DwdrD6Fs.js → Queues-JsB6NujG.js} +1 -1
- package/dist/assets/{QueuesOverview-CQdc1MDE.js → QueuesOverview-BB8UL0nT.js} +1 -1
- package/dist/assets/{S3Backup-9rl71zZ0.js → S3Backup-CLizitSQ.js} +1 -1
- package/dist/assets/{S3BackupPro-BgZyvD-0.js → S3BackupPro-CoSFg6KF.js} +1 -1
- package/dist/assets/{ServerControl-C5Rh0kip.js → ServerControl-DcP14j8m.js} +1 -1
- package/dist/assets/{Settings-DmnnURrE.js → Settings-Czzagq5p.js} +1 -1
- package/dist/assets/{Usage-Df84EVYP.js → Usage-DGv7A2XQ.js} +1 -1
- package/dist/assets/{UsagePro-xAJXeKjl.js → UsagePro-Cre49W5i.js} +1 -1
- package/dist/assets/{Webhooks-CxKY1jum.js → Webhooks-C0ByRD8k.js} +1 -1
- package/dist/assets/{Workers-C7btFQcD.js → Workers-BB9o9IJ6.js} +1 -1
- package/dist/assets/{WorkersPro-CsGyS9Aq.js → WorkersPro-DgjEEM9Y.js} +1 -1
- package/dist/assets/{index-KT02j1ql.css → index-BovL_it0.css} +1 -1
- package/dist/assets/index-Dlr2PaZ6.js +8 -0
- package/dist/assets/{useThroughputSeries-DMoDDf05.js → useThroughputSeries-lWDIzQ4F.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/scripts/embedded.gen.ts +98 -98
- package/dist/assets/index-CjnfFs1N.js +0 -8
package/dist/.vite/manifest.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"_react-vendor-B68RYDeC.js"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"_CopyButton-
|
|
11
|
-
"file": "assets/CopyButton-
|
|
10
|
+
"_CopyButton-B2gM7BeT.js": {
|
|
11
|
+
"file": "assets/CopyButton-B2gM7BeT.js",
|
|
12
12
|
"name": "CopyButton",
|
|
13
13
|
"imports": [
|
|
14
14
|
"_cn-CMFYpumL.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"index.html"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
-
"_Pagination-
|
|
20
|
-
"file": "assets/Pagination-
|
|
19
|
+
"_Pagination-C-6yLcP3.js": {
|
|
20
|
+
"file": "assets/Pagination-C-6yLcP3.js",
|
|
21
21
|
"name": "Pagination",
|
|
22
22
|
"imports": [
|
|
23
23
|
"_cn-CMFYpumL.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"index.html"
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
|
-
"_QueueActions-
|
|
29
|
-
"file": "assets/QueueActions-
|
|
28
|
+
"_QueueActions-Dhy0KXjr.js": {
|
|
29
|
+
"file": "assets/QueueActions-Dhy0KXjr.js",
|
|
30
30
|
"name": "QueueActions",
|
|
31
31
|
"imports": [
|
|
32
32
|
"_cn-CMFYpumL.js",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"_cn-CMFYpumL.js"
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
|
-
"_useThroughputSeries-
|
|
78
|
-
"file": "assets/useThroughputSeries-
|
|
77
|
+
"_useThroughputSeries-lWDIzQ4F.js": {
|
|
78
|
+
"file": "assets/useThroughputSeries-lWDIzQ4F.js",
|
|
79
79
|
"name": "useThroughputSeries",
|
|
80
80
|
"imports": [
|
|
81
81
|
"_cn-CMFYpumL.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
"index.html": {
|
|
87
|
-
"file": "assets/index-
|
|
87
|
+
"file": "assets/index-Dlr2PaZ6.js",
|
|
88
88
|
"name": "index",
|
|
89
89
|
"src": "index.html",
|
|
90
90
|
"isEntry": true,
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"src/lib/demo/install.ts"
|
|
134
134
|
],
|
|
135
135
|
"css": [
|
|
136
|
-
"assets/index-
|
|
136
|
+
"assets/index-BovL_it0.css"
|
|
137
137
|
],
|
|
138
138
|
"assets": [
|
|
139
139
|
"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"src": "node_modules/@fontsource-variable/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2"
|
|
160
160
|
},
|
|
161
161
|
"src/components/copilot/CopilotPanel.tsx": {
|
|
162
|
-
"file": "assets/CopilotPanel-
|
|
162
|
+
"file": "assets/CopilotPanel-C4u8nJMr.js",
|
|
163
163
|
"name": "CopilotPanel",
|
|
164
164
|
"src": "src/components/copilot/CopilotPanel.tsx",
|
|
165
165
|
"isDynamicEntry": true,
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"isDynamicEntry": true
|
|
178
178
|
},
|
|
179
179
|
"src/pages/Alerts.tsx": {
|
|
180
|
-
"file": "assets/Alerts-
|
|
180
|
+
"file": "assets/Alerts-CWgn7JKK.js",
|
|
181
181
|
"name": "Alerts",
|
|
182
182
|
"src": "src/pages/Alerts.tsx",
|
|
183
183
|
"isDynamicEntry": true,
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
191
|
"src/pages/Cron.tsx": {
|
|
192
|
-
"file": "assets/Cron-
|
|
192
|
+
"file": "assets/Cron-D8Cl1VQg.js",
|
|
193
193
|
"name": "Cron",
|
|
194
194
|
"src": "src/pages/Cron.tsx",
|
|
195
195
|
"isDynamicEntry": true,
|
|
@@ -197,11 +197,11 @@
|
|
|
197
197
|
"_cn-CMFYpumL.js",
|
|
198
198
|
"_react-vendor-B68RYDeC.js",
|
|
199
199
|
"index.html",
|
|
200
|
-
"_Pagination-
|
|
200
|
+
"_Pagination-C-6yLcP3.js"
|
|
201
201
|
]
|
|
202
202
|
},
|
|
203
203
|
"src/pages/Dlq.tsx": {
|
|
204
|
-
"file": "assets/Dlq-
|
|
204
|
+
"file": "assets/Dlq-ChFKsJwc.js",
|
|
205
205
|
"name": "Dlq",
|
|
206
206
|
"src": "src/pages/Dlq.tsx",
|
|
207
207
|
"isDynamicEntry": true,
|
|
@@ -210,11 +210,11 @@
|
|
|
210
210
|
"_react-vendor-B68RYDeC.js",
|
|
211
211
|
"index.html",
|
|
212
212
|
"_form-C-zZyKfB.js",
|
|
213
|
-
"_Pagination-
|
|
213
|
+
"_Pagination-C-6yLcP3.js"
|
|
214
214
|
]
|
|
215
215
|
},
|
|
216
216
|
"src/pages/Jobs.tsx": {
|
|
217
|
-
"file": "assets/Jobs-
|
|
217
|
+
"file": "assets/Jobs-CBoU-CeR.js",
|
|
218
218
|
"name": "Jobs",
|
|
219
219
|
"src": "src/pages/Jobs.tsx",
|
|
220
220
|
"isDynamicEntry": true,
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
]
|
|
227
227
|
},
|
|
228
228
|
"src/pages/Logs.tsx": {
|
|
229
|
-
"file": "assets/Logs-
|
|
229
|
+
"file": "assets/Logs-BWq4h_tj.js",
|
|
230
230
|
"name": "Logs",
|
|
231
231
|
"src": "src/pages/Logs.tsx",
|
|
232
232
|
"isDynamicEntry": true,
|
|
@@ -235,11 +235,11 @@
|
|
|
235
235
|
"_react-vendor-B68RYDeC.js",
|
|
236
236
|
"index.html",
|
|
237
237
|
"_form-C-zZyKfB.js",
|
|
238
|
-
"_Pagination-
|
|
238
|
+
"_Pagination-C-6yLcP3.js"
|
|
239
239
|
]
|
|
240
240
|
},
|
|
241
241
|
"src/pages/Metrics.tsx": {
|
|
242
|
-
"file": "assets/Metrics-
|
|
242
|
+
"file": "assets/Metrics-Cu1CHLHF.js",
|
|
243
243
|
"name": "Metrics",
|
|
244
244
|
"src": "src/pages/Metrics.tsx",
|
|
245
245
|
"isDynamicEntry": true,
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
]
|
|
250
250
|
},
|
|
251
251
|
"src/pages/Overview.tsx": {
|
|
252
|
-
"file": "assets/Overview-
|
|
252
|
+
"file": "assets/Overview-BSqH2VRL.js",
|
|
253
253
|
"name": "Overview",
|
|
254
254
|
"src": "src/pages/Overview.tsx",
|
|
255
255
|
"isDynamicEntry": true,
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
]
|
|
260
260
|
},
|
|
261
261
|
"src/pages/QueueDetail.tsx": {
|
|
262
|
-
"file": "assets/QueueDetail-
|
|
262
|
+
"file": "assets/QueueDetail-Nfc8Zu5b.js",
|
|
263
263
|
"name": "QueueDetail",
|
|
264
264
|
"src": "src/pages/QueueDetail.tsx",
|
|
265
265
|
"isDynamicEntry": true,
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
]
|
|
272
272
|
},
|
|
273
273
|
"src/pages/Queues.tsx": {
|
|
274
|
-
"file": "assets/Queues-
|
|
274
|
+
"file": "assets/Queues-JsB6NujG.js",
|
|
275
275
|
"name": "Queues",
|
|
276
276
|
"src": "src/pages/Queues.tsx",
|
|
277
277
|
"isDynamicEntry": true,
|
|
@@ -279,11 +279,11 @@
|
|
|
279
279
|
"_cn-CMFYpumL.js",
|
|
280
280
|
"_react-vendor-B68RYDeC.js",
|
|
281
281
|
"index.html",
|
|
282
|
-
"_Pagination-
|
|
282
|
+
"_Pagination-C-6yLcP3.js"
|
|
283
283
|
]
|
|
284
284
|
},
|
|
285
285
|
"src/pages/S3Backup.tsx": {
|
|
286
|
-
"file": "assets/S3Backup-
|
|
286
|
+
"file": "assets/S3Backup-CLizitSQ.js",
|
|
287
287
|
"name": "S3Backup",
|
|
288
288
|
"src": "src/pages/S3Backup.tsx",
|
|
289
289
|
"isDynamicEntry": true,
|
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
]
|
|
294
294
|
},
|
|
295
295
|
"src/pages/Settings.tsx": {
|
|
296
|
-
"file": "assets/Settings-
|
|
296
|
+
"file": "assets/Settings-Czzagq5p.js",
|
|
297
297
|
"name": "Settings",
|
|
298
298
|
"src": "src/pages/Settings.tsx",
|
|
299
299
|
"isDynamicEntry": true,
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
]
|
|
307
307
|
},
|
|
308
308
|
"src/pages/Usage.tsx": {
|
|
309
|
-
"file": "assets/Usage-
|
|
309
|
+
"file": "assets/Usage-DGv7A2XQ.js",
|
|
310
310
|
"name": "Usage",
|
|
311
311
|
"src": "src/pages/Usage.tsx",
|
|
312
312
|
"isDynamicEntry": true,
|
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
]
|
|
317
317
|
},
|
|
318
318
|
"src/pages/Workers.tsx": {
|
|
319
|
-
"file": "assets/Workers-
|
|
319
|
+
"file": "assets/Workers-BB9o9IJ6.js",
|
|
320
320
|
"name": "Workers",
|
|
321
321
|
"src": "src/pages/Workers.tsx",
|
|
322
322
|
"isDynamicEntry": true,
|
|
@@ -324,11 +324,11 @@
|
|
|
324
324
|
"_cn-CMFYpumL.js",
|
|
325
325
|
"_react-vendor-B68RYDeC.js",
|
|
326
326
|
"index.html",
|
|
327
|
-
"_Pagination-
|
|
327
|
+
"_Pagination-C-6yLcP3.js"
|
|
328
328
|
]
|
|
329
329
|
},
|
|
330
330
|
"src/pages/control/AddJob.tsx": {
|
|
331
|
-
"file": "assets/AddJob-
|
|
331
|
+
"file": "assets/AddJob-B6DB3nLS.js",
|
|
332
332
|
"name": "AddJob",
|
|
333
333
|
"src": "src/pages/control/AddJob.tsx",
|
|
334
334
|
"isDynamicEntry": true,
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
]
|
|
341
341
|
},
|
|
342
342
|
"src/pages/control/Benchmark.tsx": {
|
|
343
|
-
"file": "assets/Benchmark-
|
|
343
|
+
"file": "assets/Benchmark-C6eJlf21.js",
|
|
344
344
|
"name": "Benchmark",
|
|
345
345
|
"src": "src/pages/control/Benchmark.tsx",
|
|
346
346
|
"isDynamicEntry": true,
|
|
@@ -351,11 +351,11 @@
|
|
|
351
351
|
"index.html",
|
|
352
352
|
"_form-C-zZyKfB.js",
|
|
353
353
|
"_AreaChart-Dl_9G6GH.js",
|
|
354
|
-
"_CopyButton-
|
|
354
|
+
"_CopyButton-B2gM7BeT.js"
|
|
355
355
|
]
|
|
356
356
|
},
|
|
357
357
|
"src/pages/control/BulkAddJobs.tsx": {
|
|
358
|
-
"file": "assets/BulkAddJobs-
|
|
358
|
+
"file": "assets/BulkAddJobs-D5A-56qh.js",
|
|
359
359
|
"name": "BulkAddJobs",
|
|
360
360
|
"src": "src/pages/control/BulkAddJobs.tsx",
|
|
361
361
|
"isDynamicEntry": true,
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
]
|
|
368
368
|
},
|
|
369
369
|
"src/pages/control/CronManager.tsx": {
|
|
370
|
-
"file": "assets/CronManager-
|
|
370
|
+
"file": "assets/CronManager-DkpnKkUk.js",
|
|
371
371
|
"name": "CronManager",
|
|
372
372
|
"src": "src/pages/control/CronManager.tsx",
|
|
373
373
|
"isDynamicEntry": true,
|
|
@@ -376,11 +376,11 @@
|
|
|
376
376
|
"_react-vendor-B68RYDeC.js",
|
|
377
377
|
"index.html",
|
|
378
378
|
"_form-C-zZyKfB.js",
|
|
379
|
-
"_Pagination-
|
|
379
|
+
"_Pagination-C-6yLcP3.js"
|
|
380
380
|
]
|
|
381
381
|
},
|
|
382
382
|
"src/pages/control/Database.tsx": {
|
|
383
|
-
"file": "assets/Database-
|
|
383
|
+
"file": "assets/Database-BmdixnFB.js",
|
|
384
384
|
"name": "Database",
|
|
385
385
|
"src": "src/pages/control/Database.tsx",
|
|
386
386
|
"isDynamicEntry": true,
|
|
@@ -389,12 +389,12 @@
|
|
|
389
389
|
"_react-vendor-B68RYDeC.js",
|
|
390
390
|
"index.html",
|
|
391
391
|
"_form-C-zZyKfB.js",
|
|
392
|
-
"_Pagination-
|
|
393
|
-
"_CopyButton-
|
|
392
|
+
"_Pagination-C-6yLcP3.js",
|
|
393
|
+
"_CopyButton-B2gM7BeT.js"
|
|
394
394
|
]
|
|
395
395
|
},
|
|
396
396
|
"src/pages/control/Diagnostics.tsx": {
|
|
397
|
-
"file": "assets/Diagnostics-
|
|
397
|
+
"file": "assets/Diagnostics-DNCcEQZe.js",
|
|
398
398
|
"name": "Diagnostics",
|
|
399
399
|
"src": "src/pages/control/Diagnostics.tsx",
|
|
400
400
|
"isDynamicEntry": true,
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
]
|
|
406
406
|
},
|
|
407
407
|
"src/pages/control/DlqControl.tsx": {
|
|
408
|
-
"file": "assets/DlqControl-
|
|
408
|
+
"file": "assets/DlqControl-C0RX-JRF.js",
|
|
409
409
|
"name": "DlqControl",
|
|
410
410
|
"src": "src/pages/control/DlqControl.tsx",
|
|
411
411
|
"isDynamicEntry": true,
|
|
@@ -414,13 +414,13 @@
|
|
|
414
414
|
"_react-vendor-B68RYDeC.js",
|
|
415
415
|
"index.html",
|
|
416
416
|
"_form-C-zZyKfB.js",
|
|
417
|
-
"_Pagination-
|
|
418
|
-
"_CopyButton-
|
|
417
|
+
"_Pagination-C-6yLcP3.js",
|
|
418
|
+
"_CopyButton-B2gM7BeT.js",
|
|
419
419
|
"_exportFile-tdUeW5m5.js"
|
|
420
420
|
]
|
|
421
421
|
},
|
|
422
422
|
"src/pages/control/DlqPro.tsx": {
|
|
423
|
-
"file": "assets/DlqPro-
|
|
423
|
+
"file": "assets/DlqPro-CkDrvA_m.js",
|
|
424
424
|
"name": "DlqPro",
|
|
425
425
|
"src": "src/pages/control/DlqPro.tsx",
|
|
426
426
|
"isDynamicEntry": true,
|
|
@@ -429,13 +429,13 @@
|
|
|
429
429
|
"_react-vendor-B68RYDeC.js",
|
|
430
430
|
"index.html",
|
|
431
431
|
"_form-C-zZyKfB.js",
|
|
432
|
-
"_Pagination-
|
|
432
|
+
"_Pagination-C-6yLcP3.js",
|
|
433
433
|
"_exportFile-tdUeW5m5.js",
|
|
434
434
|
"_promisePool-Daxkc1OB.js"
|
|
435
435
|
]
|
|
436
436
|
},
|
|
437
437
|
"src/pages/control/Flows.tsx": {
|
|
438
|
-
"file": "assets/Flows-
|
|
438
|
+
"file": "assets/Flows-tVpaOy-A.js",
|
|
439
439
|
"name": "Flows",
|
|
440
440
|
"src": "src/pages/control/Flows.tsx",
|
|
441
441
|
"isDynamicEntry": true,
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
]
|
|
447
447
|
},
|
|
448
448
|
"src/pages/control/JobInspector.tsx": {
|
|
449
|
-
"file": "assets/JobInspector-
|
|
449
|
+
"file": "assets/JobInspector-B6RmHnFF.js",
|
|
450
450
|
"name": "JobInspector",
|
|
451
451
|
"src": "src/pages/control/JobInspector.tsx",
|
|
452
452
|
"isDynamicEntry": true,
|
|
@@ -455,13 +455,13 @@
|
|
|
455
455
|
"_react-vendor-B68RYDeC.js",
|
|
456
456
|
"index.html",
|
|
457
457
|
"_form-C-zZyKfB.js",
|
|
458
|
-
"_CopyButton-
|
|
458
|
+
"_CopyButton-B2gM7BeT.js",
|
|
459
459
|
"_exportFile-tdUeW5m5.js",
|
|
460
460
|
"_jobActions-CuOdMglt.js"
|
|
461
461
|
]
|
|
462
462
|
},
|
|
463
463
|
"src/pages/control/JobsPro.tsx": {
|
|
464
|
-
"file": "assets/JobsPro-
|
|
464
|
+
"file": "assets/JobsPro-WiZ3UHGN.js",
|
|
465
465
|
"name": "JobsPro",
|
|
466
466
|
"src": "src/pages/control/JobsPro.tsx",
|
|
467
467
|
"isDynamicEntry": true,
|
|
@@ -470,13 +470,13 @@
|
|
|
470
470
|
"_react-vendor-B68RYDeC.js",
|
|
471
471
|
"index.html",
|
|
472
472
|
"_form-C-zZyKfB.js",
|
|
473
|
-
"_Pagination-
|
|
473
|
+
"_Pagination-C-6yLcP3.js",
|
|
474
474
|
"_exportFile-tdUeW5m5.js",
|
|
475
475
|
"_jobActions-CuOdMglt.js"
|
|
476
476
|
]
|
|
477
477
|
},
|
|
478
478
|
"src/pages/control/LogsPro.tsx": {
|
|
479
|
-
"file": "assets/LogsPro-
|
|
479
|
+
"file": "assets/LogsPro-Bf9Ihrkj.js",
|
|
480
480
|
"name": "LogsPro",
|
|
481
481
|
"src": "src/pages/control/LogsPro.tsx",
|
|
482
482
|
"isDynamicEntry": true,
|
|
@@ -485,23 +485,23 @@
|
|
|
485
485
|
"_react-vendor-B68RYDeC.js",
|
|
486
486
|
"index.html",
|
|
487
487
|
"_form-C-zZyKfB.js",
|
|
488
|
-
"_Pagination-
|
|
489
|
-
"_CopyButton-
|
|
488
|
+
"_Pagination-C-6yLcP3.js",
|
|
489
|
+
"_CopyButton-B2gM7BeT.js"
|
|
490
490
|
]
|
|
491
491
|
},
|
|
492
492
|
"src/pages/control/McpServer.tsx": {
|
|
493
|
-
"file": "assets/McpServer-
|
|
493
|
+
"file": "assets/McpServer-DZD7-dyS.js",
|
|
494
494
|
"name": "McpServer",
|
|
495
495
|
"src": "src/pages/control/McpServer.tsx",
|
|
496
496
|
"isDynamicEntry": true,
|
|
497
497
|
"imports": [
|
|
498
498
|
"_react-vendor-B68RYDeC.js",
|
|
499
499
|
"index.html",
|
|
500
|
-
"_CopyButton-
|
|
500
|
+
"_CopyButton-B2gM7BeT.js"
|
|
501
501
|
]
|
|
502
502
|
},
|
|
503
503
|
"src/pages/control/MetricsPro.tsx": {
|
|
504
|
-
"file": "assets/MetricsPro-
|
|
504
|
+
"file": "assets/MetricsPro-Bs-Rwic_.js",
|
|
505
505
|
"name": "MetricsPro",
|
|
506
506
|
"src": "src/pages/control/MetricsPro.tsx",
|
|
507
507
|
"isDynamicEntry": true,
|
|
@@ -509,13 +509,13 @@
|
|
|
509
509
|
"_cn-CMFYpumL.js",
|
|
510
510
|
"_react-vendor-B68RYDeC.js",
|
|
511
511
|
"index.html",
|
|
512
|
-
"_Pagination-
|
|
512
|
+
"_Pagination-C-6yLcP3.js",
|
|
513
513
|
"_AreaChart-Dl_9G6GH.js",
|
|
514
|
-
"_useThroughputSeries-
|
|
514
|
+
"_useThroughputSeries-lWDIzQ4F.js"
|
|
515
515
|
]
|
|
516
516
|
},
|
|
517
517
|
"src/pages/control/QueueControl.tsx": {
|
|
518
|
-
"file": "assets/QueueControl-
|
|
518
|
+
"file": "assets/QueueControl-2x3FDkR9.js",
|
|
519
519
|
"name": "QueueControl",
|
|
520
520
|
"src": "src/pages/control/QueueControl.tsx",
|
|
521
521
|
"isDynamicEntry": true,
|
|
@@ -524,11 +524,11 @@
|
|
|
524
524
|
"_react-vendor-B68RYDeC.js",
|
|
525
525
|
"index.html",
|
|
526
526
|
"_form-C-zZyKfB.js",
|
|
527
|
-
"_QueueActions-
|
|
527
|
+
"_QueueActions-Dhy0KXjr.js"
|
|
528
528
|
]
|
|
529
529
|
},
|
|
530
530
|
"src/pages/control/QueueDetailPro.tsx": {
|
|
531
|
-
"file": "assets/QueueDetailPro-
|
|
531
|
+
"file": "assets/QueueDetailPro-CnuNbKyk.js",
|
|
532
532
|
"name": "QueueDetailPro",
|
|
533
533
|
"src": "src/pages/control/QueueDetailPro.tsx",
|
|
534
534
|
"isDynamicEntry": true,
|
|
@@ -537,12 +537,12 @@
|
|
|
537
537
|
"_react-vendor-B68RYDeC.js",
|
|
538
538
|
"index.html",
|
|
539
539
|
"_AreaChart-Dl_9G6GH.js",
|
|
540
|
-
"_useThroughputSeries-
|
|
541
|
-
"_QueueActions-
|
|
540
|
+
"_useThroughputSeries-lWDIzQ4F.js",
|
|
541
|
+
"_QueueActions-Dhy0KXjr.js"
|
|
542
542
|
]
|
|
543
543
|
},
|
|
544
544
|
"src/pages/control/QueuesOverview.tsx": {
|
|
545
|
-
"file": "assets/QueuesOverview-
|
|
545
|
+
"file": "assets/QueuesOverview-BB8UL0nT.js",
|
|
546
546
|
"name": "QueuesOverview",
|
|
547
547
|
"src": "src/pages/control/QueuesOverview.tsx",
|
|
548
548
|
"isDynamicEntry": true,
|
|
@@ -550,12 +550,12 @@
|
|
|
550
550
|
"_cn-CMFYpumL.js",
|
|
551
551
|
"_react-vendor-B68RYDeC.js",
|
|
552
552
|
"index.html",
|
|
553
|
-
"_Pagination-
|
|
553
|
+
"_Pagination-C-6yLcP3.js",
|
|
554
554
|
"_promisePool-Daxkc1OB.js"
|
|
555
555
|
]
|
|
556
556
|
},
|
|
557
557
|
"src/pages/control/S3BackupPro.tsx": {
|
|
558
|
-
"file": "assets/S3BackupPro-
|
|
558
|
+
"file": "assets/S3BackupPro-CoSFg6KF.js",
|
|
559
559
|
"name": "S3BackupPro",
|
|
560
560
|
"src": "src/pages/control/S3BackupPro.tsx",
|
|
561
561
|
"isDynamicEntry": true,
|
|
@@ -568,7 +568,7 @@
|
|
|
568
568
|
]
|
|
569
569
|
},
|
|
570
570
|
"src/pages/control/ServerControl.tsx": {
|
|
571
|
-
"file": "assets/ServerControl-
|
|
571
|
+
"file": "assets/ServerControl-DcP14j8m.js",
|
|
572
572
|
"name": "ServerControl",
|
|
573
573
|
"src": "src/pages/control/ServerControl.tsx",
|
|
574
574
|
"isDynamicEntry": true,
|
|
@@ -577,11 +577,11 @@
|
|
|
577
577
|
"_react-vendor-B68RYDeC.js",
|
|
578
578
|
"index.html",
|
|
579
579
|
"_form-C-zZyKfB.js",
|
|
580
|
-
"_CopyButton-
|
|
580
|
+
"_CopyButton-B2gM7BeT.js"
|
|
581
581
|
]
|
|
582
582
|
},
|
|
583
583
|
"src/pages/control/UsagePro.tsx": {
|
|
584
|
-
"file": "assets/UsagePro-
|
|
584
|
+
"file": "assets/UsagePro-Cre49W5i.js",
|
|
585
585
|
"name": "UsagePro",
|
|
586
586
|
"src": "src/pages/control/UsagePro.tsx",
|
|
587
587
|
"isDynamicEntry": true,
|
|
@@ -591,7 +591,7 @@
|
|
|
591
591
|
]
|
|
592
592
|
},
|
|
593
593
|
"src/pages/control/Webhooks.tsx": {
|
|
594
|
-
"file": "assets/Webhooks-
|
|
594
|
+
"file": "assets/Webhooks-C0ByRD8k.js",
|
|
595
595
|
"name": "Webhooks",
|
|
596
596
|
"src": "src/pages/control/Webhooks.tsx",
|
|
597
597
|
"isDynamicEntry": true,
|
|
@@ -600,11 +600,11 @@
|
|
|
600
600
|
"_react-vendor-B68RYDeC.js",
|
|
601
601
|
"index.html",
|
|
602
602
|
"_form-C-zZyKfB.js",
|
|
603
|
-
"_Pagination-
|
|
603
|
+
"_Pagination-C-6yLcP3.js"
|
|
604
604
|
]
|
|
605
605
|
},
|
|
606
606
|
"src/pages/control/WorkersPro.tsx": {
|
|
607
|
-
"file": "assets/WorkersPro-
|
|
607
|
+
"file": "assets/WorkersPro-DgjEEM9Y.js",
|
|
608
608
|
"name": "WorkersPro",
|
|
609
609
|
"src": "src/pages/control/WorkersPro.tsx",
|
|
610
610
|
"isDynamicEntry": true,
|
|
@@ -1,3 +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{C as a,T as o,h as s,k as c,nt as l,rt as u,w as d}from"./index-
|
|
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{C as a,T as o,h as s,k as c,nt as l,rt as u,w as d}from"./index-Dlr2PaZ6.js";import{n as f,o as p,t as m}from"./form-C-zZyKfB.js";var h=e(t(),1),g=i(),_=e=>e==null?``:String(e);function v(){let{data:e}=c(()=>l.queues(),[],{intervalMs:3e4}),t=n().state?.clone,i=t?.options??{},[p,v]=(0,h.useState)(t?.queue??``),[b,x]=(0,h.useState)(t?.dataText??`{
|
|
2
2
|
"hello": "world"
|
|
3
3
|
}`),[S,C]=(0,h.useState)(`1`),[w,T]=(0,h.useState)(_(i.priority)),[E,D]=(0,h.useState)(``),[O,k]=(0,h.useState)(``),[A,j]=(0,h.useState)(_(i.maxAttempts)),[M,N]=(0,h.useState)(_(i.backoff)),[P,F]=(0,h.useState)(_(i.timeout)),[I,L]=(0,h.useState)(``),[R,z]=(0,h.useState)(i.removeOnComplete??!1),[B,V]=(0,h.useState)(i.removeOnFail??!1),[H,U]=(0,h.useState)(!1),[W,G]=(0,h.useState)(!1),[K,q]=(0,h.useState)(!1),[J,Y]=(0,h.useState)(null),[X,Z]=(0,h.useState)(null),Q=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},$=async()=>{if(Y(null),Z(null),!p.trim()){Y({ok:!1,msg:`Choose a queue`});return}let e;try{e=JSON.parse(b)}catch(e){Z(`Invalid JSON: ${e.message}`);return}let t=Q(E);if(O.trim()){let e=new Date(O).getTime();if(!Number.isFinite(e)){Y({ok:!1,msg:`Run at is not a valid date/time`});return}t=Math.max(0,e-Date.now())}let n={data:e,priority:Q(w),delay:t,maxAttempts:Q(A),backoff:Q(M),timeout:Q(P),jobId:I.trim()||void 0,removeOnComplete:R||void 0,removeOnFail:B||void 0,durable:H||void 0,lifo:W||void 0},r=Q(S)??1;if(!Number.isInteger(r)||r<1){Y({ok:!1,msg:`Count must be an integer of at least 1`});return}if(r>1e4){Y({ok:!1,msg:`Count must be 10000 or fewer`});return}q(!0);try{if(r===1){let e=await l.addJob(p,n);Y({ok:!0,msg:`Created job ${e.id}`}),u.success(`Job created`,`${p} · ${e.id}`)}else{let e=await l.addJobsBulk(p,Array.from({length:r},()=>n)),t=new Set(e.ids).size;Y({ok:!0,msg:`Created ${t} job${t===1?``:`s`}`}),u.success(`Created ${t} job${t===1?``:`s`}`,`in ${p}`)}}catch(e){Y({ok:!1,msg:e.message}),u.error(`Add job failed`,e.message)}finally{q(!1)}};return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(s,{title:`Add Job`,description:`Enqueue a job with full options.`,actions:(0,g.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,g.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,g.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),$()},children:[(0,g.jsxs)(a,{children:[(0,g.jsx)(d,{title:`Job`}),(0,g.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,g.jsxs)(m,{label:`Queue`,children:[(0,g.jsx)(f,{list:`queue-options`,value:p,onChange:e=>v(e.target.value),placeholder:`queue name (existing or new)`}),(0,g.jsx)(`datalist`,{id:`queue-options`,children:(e?.queues??[]).map(e=>(0,g.jsx)(`option`,{value:e.name},e.name))})]}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(m,{label:`Data (JSON)`,children:(0,g.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value),onBlur:()=>{try{JSON.parse(b),Z(null)}catch(e){Z(`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`})}),X&&(0,g.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:X})]})]})]}),(0,g.jsxs)(a,{children:[(0,g.jsx)(d,{title:`Options`}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,g.jsx)(m,{label:`Priority`,children:(0,g.jsx)(f,{type:`number`,value:w,onChange:e=>T(e.target.value),placeholder:`0`})}),(0,g.jsx)(m,{label:`Delay (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:E,onChange:e=>D(e.target.value),placeholder:`0`,disabled:O.trim()!==``})}),(0,g.jsx)(m,{label:`Run at`,hint:O.trim()?`Overrides Delay — derived from this time (local time).`:`(local time)`,children:(0,g.jsx)(f,{type:`datetime-local`,value:O,onChange:e=>k(e.target.value)})}),(0,g.jsx)(m,{label:`Max attempts`,hint:`blank = server default`,children:(0,g.jsx)(f,{type:`number`,min:1,value:A,onChange:e=>j(e.target.value),placeholder:`3`})}),(0,g.jsx)(m,{label:`Backoff (ms)`,hint:`blank = server default`,children:(0,g.jsx)(f,{type:`number`,min:0,value:M,onChange:e=>N(e.target.value),placeholder:`1000`})}),(0,g.jsx)(m,{label:`Timeout (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:P,onChange:e=>F(e.target.value),placeholder:`—`})}),(0,g.jsx)(m,{label:`Custom job ID`,children:(0,g.jsx)(f,{value:I,onChange:e=>L(e.target.value),placeholder:`idempotency key`})})]}),(0,g.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,g.jsx)(y,{label:`removeOnComplete`,checked:R,onChange:z}),(0,g.jsx)(y,{label:`removeOnFail`,checked:B,onChange:V}),(0,g.jsx)(y,{label:`durable`,checked:H,onChange:U}),(0,g.jsx)(y,{label:`lifo`,checked:W,onChange:G})]})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,g.jsx)(`div`,{className:`w-28`,children:(0,g.jsx)(m,{label:`Count`,hint:`1–10000`,children:(0,g.jsx)(f,{type:`number`,min:1,value:S,onChange:e=>C(e.target.value)})})}),(0,g.jsx)(o,{type:`submit`,variant:`accent`,disabled:K,children:K?`Adding…`:`Add job`}),J&&(0,g.jsx)(`span`,{role:`status`,className:J.ok?`text-sm text-success`:`text-sm text-danger`,children:J.msg})]})]})]})}function y({label:e,checked:t,onChange:n}){return(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(p,{checked:t,onChange:n,label:e}),(0,g.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e})]})}export{v 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,C as i,E as a,M as o,Q as s,T as c,Y as l,at as u,h as d,it as f,u as p,y 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,C as i,E as a,M as o,Q as s,T as c,Y as l,at as u,h as d,it as f,u as p,y as m}from"./index-Dlr2PaZ6.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(f),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}=u(),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)(d,{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)(o,{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)(c,{size:`sm`,onClick:async()=>{A(await s())},children:`Enable desktop notifications`}),(0,b.jsx)(c,{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)(m,{icon:(0,b.jsx)(o,{}),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:p(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)(i,{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)(a,{"aria-label":`Remove channel`,onClick:()=>h(e.id),children:(0,b.jsx)(l,{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)(i,{className:`mb-4`,children:(0,b.jsx)(k,{onAdd:e=>{g(e),w(!1)}})}),t.length===0?(0,b.jsx)(m,{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:[f[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)(a,{"aria-label":`Delete rule`,onClick:()=>v(e.id),children:(0,b.jsx)(l,{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)(c,{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,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(``),[p,m]=(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:f[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=>l(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:u,onChange:e=>d(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:p,onChange:e=>m(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)(c,{variant:`accent`,disabled:!t||!s,onClick:()=>e({name:t,metric:r,operator:a,threshold:Number(s),queue:r===`p99_latency`?``:u,channel:p,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{C as a,T as o,U as s,W as c,c as l,h as u,k as d,m as f,nt as p,r as m,s as h,w as g}from"./index-CjnfFs1N.js";import{i as _,n as v,o as y,t as b}from"./form-C-zZyKfB.js";import{t as x}from"./AreaChart-Dl_9G6GH.js";import{t as S}from"./CopyButton-fN1FbSIy.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)(a,{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)(o,{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)(o,{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:l(e.pushed)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:l(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:h(e.p95)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:h(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),m=(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=m.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 p.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,m.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 p.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 p.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=M(e)}if(t.length>0){b>0&&await j(b,()=>!u.current);try{await p.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}=d(()=>p.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 ${l(q.waiting??0)} waiting / ${l(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 p.clean(t,{state:n,limit:w.total})}catch(t){e=t.message}let n=await p.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 ${h(O.etaMs)}`:`finishing…`:S===`stopped`?`stopped early`:S===`done`?`complete`:``;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(u,{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)(o,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,P.jsx)(s,{className:`size-3.5`}),` Stopping…`]}):j?(0,P.jsxs)(o,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,P.jsx)(s,{className:`size-3.5`}),` Stop`]}):(0,P.jsxs)(o,{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)(c,{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)(a,{className:`lg:col-span-1`,children:[(0,P.jsx)(g,{title:`Configuration`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(b,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,P.jsx)(v,{value:e.queue,disabled:j,onChange:e=>M(`queue`,e.target.value)})}),(0,P.jsx)(b,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,P.jsx)(_,{options:B,value:e.mode,onChange:e=>M(`mode`,e),disabled:j})}),e.mode===`count`?(0,P.jsx)(b,{label:`Total jobs`,hint:`max ${l(w.total)}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.total,value:e.total,disabled:j,onChange:I(`total`)})}):(0,P.jsx)(b,{label:`Duration (s)`,hint:`max ${w.durationS}s`,children:(0,P.jsx)(v,{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)(b,{label:`Producers`,hint:`parallel, max ${w.producers}`,children:(0,P.jsx)(v,{type:`number`,min:e.mode===`duration`?0:1,max:w.producers,value:e.producers,disabled:j,onChange:I(`producers`)})}),(0,P.jsx)(b,{label:`Push batch`,hint:`jobs/req, max ${w.batch}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.batch,value:e.batch,disabled:j,onChange:I(`batch`)})}),(0,P.jsx)(b,{label:`Payload`,hint:`bytes/job, max ${l(w.payload)}`,children:(0,P.jsx)(v,{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)(b,{label:`Workers`,hint:`0 = produce only, max ${w.workers}`,children:(0,P.jsx)(v,{type:`number`,min:0,max:w.workers,value:e.workers,disabled:j,onChange:I(`workers`)})}),(0,P.jsx)(b,{label:`Pull batch`,hint:`jobs/pull, max ${w.workerBatch}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.workerBatch,value:e.workerBatch,disabled:j,onChange:I(`workerBatch`)})}),(0,P.jsx)(b,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,P.jsx)(v,{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)(y,{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)(y,{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)(o,{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 — ${l(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)(a,{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)(f,{label:`Pushed`,value:l(O.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(O.completed),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Push/sec`,value:N(O.pushPerSec),compact:!0}),(0,P.jsx)(f,{label:`Done/sec`,value:N(O.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Elapsed`,value:h(O.elapsedMs),compact:!0}),(0,P.jsx)(f,{label:`Active workers`,value:`${O.activeWorkers}/${re}`,tone:`blue`,compact:!0}),(0,P.jsx)(f,{label:`Data`,value:m(k?.bytes??O.bytes),compact:!0}),(0,P.jsx)(f,{label:`Errors`,value:l((k?.pushFailed??O.pushFailed)+(k?.ackFailed??O.ackFailed)),tone:O.pushFailed+O.ackFailed?`red`:`default`,compact:!0})]})]}),(0,P.jsxs)(a,{children:[(0,P.jsx)(g,{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)(x,{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)(a,{className:`mt-6`,children:[(0,P.jsx)(g,{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)(f,{label:`Pushed`,value:l(k.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(k.completed),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Duration`,value:h(k.durationMs),compact:!0}),(0,P.jsx)(f,{label:`Avg push/s`,value:N(k.pushPerSec),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Avg done/s`,value:N(k.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Data rate`,value:`${m(k.mbPerSec)}/s`,compact:!0}),(0,P.jsx)(f,{label:`Push p95`,value:h(k.p95),compact:!0}),(0,P.jsx)(f,{label:`Push p99`,value:h(k.p99),compact:!0})]}),(0,P.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,h(k.avg),` · p50 `,h(k.p50),` · p95`,` `,h(k.p95),` · p99 `,h(k.p99),` · max `,h(k.max),`.`,k.error?` First error: ${k.error}`:``]})]}),(0,P.jsxs)(a,{className:`mt-6`,children:[(0,P.jsx)(g,{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)(f,{label:`Waiting`,value:l(q.waiting??0),tone:`amber`,compact:!0}),(0,P.jsx)(f,{label:`Active`,value:l(q.active??0),tone:`blue`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(q.completed??0),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Failed`,value:l(q.failed??0),tone:q.failed?`red`:`default`,compact:!0}),(0,P.jsx)(f,{label:`Delayed`,value:l(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{C as a,T as o,U as s,W as c,c as l,h as u,k as d,m as f,nt as p,r as m,s as h,w as g}from"./index-Dlr2PaZ6.js";import{i as _,n as v,o as y,t as b}from"./form-C-zZyKfB.js";import{t as x}from"./AreaChart-Dl_9G6GH.js";import{t as S}from"./CopyButton-B2gM7BeT.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)(a,{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)(o,{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)(o,{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:l(e.pushed)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:l(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:h(e.p95)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:h(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),m=(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=m.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 p.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,m.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 p.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 p.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=M(e)}if(t.length>0){b>0&&await j(b,()=>!u.current);try{await p.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}=d(()=>p.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 ${l(q.waiting??0)} waiting / ${l(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 p.clean(t,{state:n,limit:w.total})}catch(t){e=t.message}let n=await p.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 ${h(O.etaMs)}`:`finishing…`:S===`stopped`?`stopped early`:S===`done`?`complete`:``;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(u,{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)(o,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,P.jsx)(s,{className:`size-3.5`}),` Stopping…`]}):j?(0,P.jsxs)(o,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,P.jsx)(s,{className:`size-3.5`}),` Stop`]}):(0,P.jsxs)(o,{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)(c,{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)(a,{className:`lg:col-span-1`,children:[(0,P.jsx)(g,{title:`Configuration`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(b,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,P.jsx)(v,{value:e.queue,disabled:j,onChange:e=>M(`queue`,e.target.value)})}),(0,P.jsx)(b,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,P.jsx)(_,{options:B,value:e.mode,onChange:e=>M(`mode`,e),disabled:j})}),e.mode===`count`?(0,P.jsx)(b,{label:`Total jobs`,hint:`max ${l(w.total)}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.total,value:e.total,disabled:j,onChange:I(`total`)})}):(0,P.jsx)(b,{label:`Duration (s)`,hint:`max ${w.durationS}s`,children:(0,P.jsx)(v,{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)(b,{label:`Producers`,hint:`parallel, max ${w.producers}`,children:(0,P.jsx)(v,{type:`number`,min:e.mode===`duration`?0:1,max:w.producers,value:e.producers,disabled:j,onChange:I(`producers`)})}),(0,P.jsx)(b,{label:`Push batch`,hint:`jobs/req, max ${w.batch}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.batch,value:e.batch,disabled:j,onChange:I(`batch`)})}),(0,P.jsx)(b,{label:`Payload`,hint:`bytes/job, max ${l(w.payload)}`,children:(0,P.jsx)(v,{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)(b,{label:`Workers`,hint:`0 = produce only, max ${w.workers}`,children:(0,P.jsx)(v,{type:`number`,min:0,max:w.workers,value:e.workers,disabled:j,onChange:I(`workers`)})}),(0,P.jsx)(b,{label:`Pull batch`,hint:`jobs/pull, max ${w.workerBatch}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.workerBatch,value:e.workerBatch,disabled:j,onChange:I(`workerBatch`)})}),(0,P.jsx)(b,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,P.jsx)(v,{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)(y,{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)(y,{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)(o,{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 — ${l(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)(a,{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)(f,{label:`Pushed`,value:l(O.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(O.completed),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Push/sec`,value:N(O.pushPerSec),compact:!0}),(0,P.jsx)(f,{label:`Done/sec`,value:N(O.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Elapsed`,value:h(O.elapsedMs),compact:!0}),(0,P.jsx)(f,{label:`Active workers`,value:`${O.activeWorkers}/${re}`,tone:`blue`,compact:!0}),(0,P.jsx)(f,{label:`Data`,value:m(k?.bytes??O.bytes),compact:!0}),(0,P.jsx)(f,{label:`Errors`,value:l((k?.pushFailed??O.pushFailed)+(k?.ackFailed??O.ackFailed)),tone:O.pushFailed+O.ackFailed?`red`:`default`,compact:!0})]})]}),(0,P.jsxs)(a,{children:[(0,P.jsx)(g,{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)(x,{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)(a,{className:`mt-6`,children:[(0,P.jsx)(g,{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)(f,{label:`Pushed`,value:l(k.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(k.completed),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Duration`,value:h(k.durationMs),compact:!0}),(0,P.jsx)(f,{label:`Avg push/s`,value:N(k.pushPerSec),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Avg done/s`,value:N(k.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Data rate`,value:`${m(k.mbPerSec)}/s`,compact:!0}),(0,P.jsx)(f,{label:`Push p95`,value:h(k.p95),compact:!0}),(0,P.jsx)(f,{label:`Push p99`,value:h(k.p99),compact:!0})]}),(0,P.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,h(k.avg),` · p50 `,h(k.p50),` · p95`,` `,h(k.p95),` · p99 `,h(k.p99),` · max `,h(k.max),`.`,k.error?` First error: ${k.error}`:``]})]}),(0,P.jsxs)(a,{className:`mt-6`,children:[(0,P.jsx)(g,{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)(f,{label:`Waiting`,value:l(q.waiting??0),tone:`amber`,compact:!0}),(0,P.jsx)(f,{label:`Active`,value:l(q.active??0),tone:`blue`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(q.completed??0),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Failed`,value:l(q.failed??0),tone:q.failed?`red`:`default`,compact:!0}),(0,P.jsx)(f,{label:`Delayed`,value:l(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};
|