@lunora/studio 1.0.0-alpha.59 → 1.0.0-alpha.60
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/index.d.ts +1 -1
- package/dist/index.js +1 -43
- package/dist/mount.js +1 -27
- package/dist/packem_chunks/ApiTab.js +1 -251
- package/dist/packem_chunks/AuditPanel.js +1 -200
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -664
- package/dist/packem_chunks/ExportImportPanel.js +3 -198
- package/dist/packem_chunks/FileBrowser.js +4 -2955
- package/dist/packem_chunks/FunctionRunner.js +1 -326
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -377
- package/dist/packem_chunks/HealthPanel.js +1 -648
- package/dist/packem_chunks/InsightsPanel.js +1 -462
- package/dist/packem_chunks/LogsPanel.js +1 -1303
- package/dist/packem_chunks/MailPanel.js +2 -353
- package/dist/packem_chunks/MetricsPanel.js +1 -1960
- package/dist/packem_chunks/MigrationsPanel.js +1 -239
- package/dist/packem_chunks/NotificationsPanel.js +1 -306
- package/dist/packem_chunks/PitrPanel.js +1 -252
- package/dist/packem_chunks/SchemaViewer.js +1 -2512
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -95
- package/dist/packem_chunks/SettingsPanel.js +1 -391
- package/dist/packem_chunks/SqlEditorPanel.js +4 -2340
- package/dist/packem_chunks/TableEditor.js +1 -290
- package/dist/packem_chunks/agents-panel.js +1 -326
- package/dist/packem_chunks/analytics-panel.js +1 -261
- package/dist/packem_chunks/auth-audit-panel.js +1 -247
- package/dist/packem_chunks/auth-config-panel.js +1 -365
- package/dist/packem_chunks/auth-sessions-panel.js +1 -175
- package/dist/packem_chunks/containers-panel.js +1 -261
- package/dist/packem_chunks/dashboards-panel.js +1 -781
- package/dist/packem_chunks/fanout-panel.js +1 -482
- package/dist/packem_chunks/flags-panel.js +1 -176
- package/dist/packem_chunks/issues-panel.js +1 -427
- package/dist/packem_chunks/kv-browser.js +1 -1896
- package/dist/packem_chunks/log-drains-panel.js +4 -273
- package/dist/packem_chunks/organizations-panel.js +1 -3209
- package/dist/packem_chunks/payments-panel.js +1 -213
- package/dist/packem_chunks/permissions-panel.js +1 -805
- package/dist/packem_chunks/queues-panel.js +1 -1075
- package/dist/packem_chunks/rls-panel.js +1 -315
- package/dist/packem_chunks/schedule-panel.js +1 -831
- package/dist/packem_chunks/sparkline.js +1 -79
- package/dist/packem_chunks/storage-rules-panel.js +1 -140
- package/dist/packem_chunks/subscriptions-panel.js +1 -238
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -747
- package/dist/packem_chunks/users-panel.js +1 -1731
- package/dist/packem_chunks/vector-browser.js +1 -281
- package/dist/packem_chunks/workflows-panel.js +1 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-23HKRH5H.js +13 -0
- package/dist/standalone/chunk-2A4RKII2.js +1 -0
- package/dist/standalone/chunk-3DTM4GI5.js +1 -0
- package/dist/standalone/chunk-3MHKT76P.js +1 -0
- package/dist/standalone/chunk-46IB4C4Q.js +1 -0
- package/dist/standalone/chunk-4AYEV5UN.js +1 -0
- package/dist/standalone/chunk-4FNHHFWR.js +1 -0
- package/dist/standalone/chunk-6CLVIOCB.js +1 -0
- package/dist/standalone/chunk-6I62RSI5.js +1 -0
- package/dist/standalone/chunk-6OKDCV7J.js +1 -0
- package/dist/standalone/chunk-6P7HIPUE.js +1 -0
- package/dist/standalone/chunk-6UYILUSX.js +1 -0
- package/dist/standalone/chunk-725RLB7D.js +1 -0
- package/dist/standalone/chunk-7AZZ7OJO.js +1 -0
- package/dist/standalone/chunk-7CRLAMGB.js +1 -0
- package/dist/standalone/chunk-7Z5QEFR4.js +2 -0
- package/dist/standalone/chunk-AGVJJQFL.js +1 -0
- package/dist/standalone/chunk-AKTGRZXN.js +1 -0
- package/dist/standalone/chunk-BAIN7UJ4.js +1 -0
- package/dist/standalone/chunk-BHWSIIDT.js +1 -0
- package/dist/standalone/{chunk-L7SK4ZZD.js → chunk-C4O5UR4Y.js} +1 -1
- package/dist/standalone/chunk-C4VURT57.js +1 -0
- package/dist/standalone/chunk-CKO3F55C.js +4 -0
- package/dist/standalone/chunk-CVMRZUF5.js +4 -0
- package/dist/standalone/chunk-CWWGDW4V.js +1 -0
- package/dist/standalone/chunk-CYET4BRZ.js +1 -0
- package/dist/standalone/chunk-CZEUVNCQ.js +1 -0
- package/dist/standalone/chunk-FXFK4M4E.js +1 -0
- package/dist/standalone/chunk-FYAJPWE7.js +1 -0
- package/dist/standalone/chunk-GS7OBQO5.js +1 -0
- package/dist/standalone/chunk-GTXVH7I5.js +1 -0
- package/dist/standalone/chunk-H6SIM4BT.js +1 -0
- package/dist/standalone/chunk-H6WOFY6A.js +8 -0
- package/dist/standalone/chunk-HA34GYEX.js +1 -0
- package/dist/standalone/chunk-HMIOF5GV.js +1 -0
- package/dist/standalone/chunk-HY46NTNW.js +6 -0
- package/dist/standalone/chunk-IBCKC2BO.js +1 -0
- package/dist/standalone/chunk-ICKBVXPP.js +1 -0
- package/dist/standalone/chunk-IE4ROTQD.js +1 -0
- package/dist/standalone/chunk-IYYTWZ2E.js +2 -0
- package/dist/standalone/chunk-J2LMP2A7.js +1 -0
- package/dist/standalone/chunk-JC6WYIHM.js +1 -0
- package/dist/standalone/chunk-JKPK25JO.js +1 -0
- package/dist/standalone/chunk-JLFCXBNQ.js +1 -0
- package/dist/standalone/chunk-JRWBGR5B.js +1 -0
- package/dist/standalone/chunk-K5PFWU5J.js +1 -0
- package/dist/standalone/chunk-KJTLW5W2.js +11 -0
- package/dist/standalone/{chunk-HBGS4SEX.js → chunk-KLLYGWNF.js} +9 -9
- package/dist/standalone/chunk-KNN3ZEQ7.js +1 -0
- package/dist/standalone/{chunk-4QHKBC77.js → chunk-KOC5KV3E.js} +1 -1
- package/dist/standalone/chunk-KSRXMTBV.js +1 -0
- package/dist/standalone/chunk-KYCAYNXM.js +1 -0
- package/dist/standalone/chunk-KZ2YUNMR.js +1 -0
- package/dist/standalone/chunk-LKHUVEHX.js +1 -0
- package/dist/standalone/chunk-LPOKAJT4.js +4 -0
- package/dist/standalone/chunk-MZEK4SGD.js +1 -0
- package/dist/standalone/chunk-NCCUM26H.js +1 -0
- package/dist/standalone/chunk-O62HJZV3.js +1 -0
- package/dist/standalone/chunk-OTJOI23O.js +62 -0
- package/dist/standalone/chunk-P2NBOUGZ.js +1 -0
- package/dist/standalone/chunk-P4J6XNG3.js +1 -0
- package/dist/standalone/chunk-PGDWFWH5.js +1 -0
- package/dist/standalone/chunk-PR2SE2MD.js +1 -0
- package/dist/standalone/chunk-PTTDIYGP.js +1 -0
- package/dist/standalone/chunk-PWDMXMRD.js +1 -0
- package/dist/standalone/chunk-Q34MSC2F.js +1 -0
- package/dist/standalone/chunk-Q5WXTZWX.js +1 -0
- package/dist/standalone/chunk-QC5HCNJZ.js +4 -0
- package/dist/standalone/chunk-QJKRHZYV.js +1 -0
- package/dist/standalone/chunk-R43KHQDA.js +1 -0
- package/dist/standalone/chunk-RC2K5RBE.js +1 -0
- package/dist/standalone/chunk-RE6UWCMG.js +1 -0
- package/dist/standalone/chunk-RUP3M2GF.js +3 -0
- package/dist/standalone/chunk-SA6MBPBL.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SEDZDNQF.js} +1 -1
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SKJZDOHG.js +1 -0
- package/dist/standalone/chunk-SNDYNCAA.js +1 -0
- package/dist/standalone/chunk-SZUHZ2OG.js +1 -0
- package/dist/standalone/chunk-TAE2H7PU.js +1 -0
- package/dist/standalone/chunk-TEIBKU46.js +1 -0
- package/dist/standalone/chunk-TO6NLVFD.js +1 -0
- package/dist/standalone/chunk-TYTJDFX2.js +1 -0
- package/dist/standalone/{chunk-LXULVPEM.js → chunk-UDZY7MKE.js} +3 -3
- package/dist/standalone/chunk-UHHTEBC3.js +1 -0
- package/dist/standalone/chunk-UNDFOYRI.js +1 -0
- package/dist/standalone/chunk-UNN4CESU.js +1 -0
- package/dist/standalone/chunk-UNXX5GQH.js +1 -0
- package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-UREY4GLG.js} +1 -1
- package/dist/standalone/chunk-UWF5DOGV.js +1 -0
- package/dist/standalone/chunk-UY2Y5CXB.js +1 -0
- package/dist/standalone/{chunk-VLXV72QE.js → chunk-UZYGEOWY.js} +1 -1
- package/dist/standalone/chunk-V66TSUKV.js +1 -0
- package/dist/standalone/chunk-VEFNSN7P.js +1 -0
- package/dist/standalone/chunk-VUJGR4PB.js +1 -0
- package/dist/standalone/chunk-VUXJER3D.js +1 -0
- package/dist/standalone/chunk-W572365D.js +1 -0
- package/dist/standalone/chunk-WYFLGXZ3.js +3 -0
- package/dist/standalone/chunk-XDKFPBIL.js +1 -0
- package/dist/standalone/chunk-XRKCGQM2.js +1 -0
- package/dist/standalone/chunk-YNBJ6ICE.js +1 -0
- package/dist/standalone/chunk-YQ5PILIJ.js +1 -0
- package/dist/standalone/chunk-YT7VXQVX.js +1 -0
- package/dist/standalone/chunk-Z7MUQMLE.js +1 -0
- package/dist/standalone/chunk-ZFWEPGWG.js +1 -0
- package/dist/standalone/chunk-ZMFZRGAN.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/package.json +4 -4
- package/dist/packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js +0 -62
- package/dist/packem_shared/ApiDocsPanel-DNDpeR5O.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-ChlRsAXU.js +0 -230
- package/dist/packem_shared/CommandPalette-BpkopP5f.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-obTn4sKX.js +0 -4493
- package/dist/packem_shared/DataFilters-B1Q7mrt7.js +0 -253
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-BCaohHZ5.js +0 -293
- package/dist/packem_shared/HomePanel-DCRj3hGB.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-CIeQE1aE.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-BQzQo84k.js +0 -262
- package/dist/packem_shared/ShardInput-CZnpHILL.js +0 -107
- package/dist/packem_shared/Studio-DnlPCbID.js +0 -16
- package/dist/packem_shared/StudioApp-CzqlB4zO.js +0 -708
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D95sN-wO.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-L4gOP5gJ.js +0 -105
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-F2vH_aj2.js +0 -175
- package/dist/packem_shared/cf-links-SIbyi4Y1.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-BywzWfek.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/error-alert-D9uIFJUS.js +0 -114
- package/dist/packem_shared/grid-features-ZOLhHKrR.js +0 -809
- package/dist/packem_shared/home-panel-BRAA2UlM.js +0 -1889
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DzHCc2Rq.js +0 -131
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/log-fields-jEH83H2G.js +0 -18
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-DfXN7oWP.js +0 -2127
- package/dist/packem_shared/result-chart-Bf9mbCIo.js +0 -119
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
- package/dist/packem_shared/select-D9OwHEch.js +0 -273
- package/dist/packem_shared/shard-history-AxiJ1WPP.js +0 -16
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-8QSXbZ98.js +0 -4192
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-gCE17v9B.js +0 -842
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/trace-handoff-CGolF3KS.js +0 -38
- package/dist/packem_shared/use-admin-query-C7JNuQp-.js +0 -106
- package/dist/packem_shared/use-async-submit-rnSk_jXl.js +0 -91
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2MLA6WFH.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-2TJVFKD2.js +0 -1
- package/dist/standalone/chunk-2YTF6LJ6.js +0 -1
- package/dist/standalone/chunk-3GXGLNKW.js +0 -1
- package/dist/standalone/chunk-3HGNPZBN.js +0 -1
- package/dist/standalone/chunk-3LJEGSMK.js +0 -11
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-4PC7IXNY.js +0 -1
- package/dist/standalone/chunk-56XQYNUJ.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-5QT5JRXD.js +0 -3
- package/dist/standalone/chunk-6RLPR7PL.js +0 -1
- package/dist/standalone/chunk-6V74EUPK.js +0 -1
- package/dist/standalone/chunk-7EE33WLB.js +0 -1
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AN4RKMKW.js +0 -1
- package/dist/standalone/chunk-APSSZB6Z.js +0 -1
- package/dist/standalone/chunk-AXNGWSBM.js +0 -1
- package/dist/standalone/chunk-AXZILWRM.js +0 -1
- package/dist/standalone/chunk-C7RHEBOH.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-CSWIYOB3.js +0 -1
- package/dist/standalone/chunk-D3VAON25.js +0 -1
- package/dist/standalone/chunk-DDLQN67F.js +0 -1
- package/dist/standalone/chunk-DGHW5JG5.js +0 -1
- package/dist/standalone/chunk-DMCSOTAE.js +0 -3
- package/dist/standalone/chunk-E3BKETAS.js +0 -1
- package/dist/standalone/chunk-E3OXNN6O.js +0 -1
- package/dist/standalone/chunk-E6BOGDIS.js +0 -1
- package/dist/standalone/chunk-F2YMCQ6B.js +0 -1
- package/dist/standalone/chunk-F7GE4X2U.js +0 -1
- package/dist/standalone/chunk-FAVUOGJR.js +0 -1
- package/dist/standalone/chunk-FXP6256Q.js +0 -1
- package/dist/standalone/chunk-G6CTAYHJ.js +0 -1
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-H42W62SE.js +0 -1
- package/dist/standalone/chunk-HTF5ZX4I.js +0 -8
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-I2PS4L74.js +0 -1
- package/dist/standalone/chunk-IYHPYY4A.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-J7OGP4NN.js +0 -1
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-JZLGLG4T.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-L2LN3MK4.js +0 -4
- package/dist/standalone/chunk-LT3FH6MW.js +0 -1
- package/dist/standalone/chunk-LZUWZBPE.js +0 -1
- package/dist/standalone/chunk-M4JM3TOY.js +0 -1
- package/dist/standalone/chunk-MLA5ZAEB.js +0 -1
- package/dist/standalone/chunk-MRBI5HNQ.js +0 -1
- package/dist/standalone/chunk-N5XX4HOL.js +0 -6
- package/dist/standalone/chunk-N7SVJOHN.js +0 -1
- package/dist/standalone/chunk-NKFXMDOD.js +0 -1
- package/dist/standalone/chunk-NPSNKFHE.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-O7FVPUCO.js +0 -1
- package/dist/standalone/chunk-OKQXTLFX.js +0 -1
- package/dist/standalone/chunk-OXHHSUXO.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QAIM6KWT.js +0 -1
- package/dist/standalone/chunk-QCPMTB6W.js +0 -1
- package/dist/standalone/chunk-QQ2LOSZL.js +0 -1
- package/dist/standalone/chunk-QVIPA6UJ.js +0 -1
- package/dist/standalone/chunk-QVUQXJCT.js +0 -4
- package/dist/standalone/chunk-R2GMHLJY.js +0 -1
- package/dist/standalone/chunk-RD5UG2YL.js +0 -1
- package/dist/standalone/chunk-RJTIP3WF.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-SHERR7ZP.js +0 -1
- package/dist/standalone/chunk-SOC5CY3F.js +0 -1
- package/dist/standalone/chunk-SS7JLF2I.js +0 -4
- package/dist/standalone/chunk-SWWYUGPL.js +0 -2
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TTXRHJUP.js +0 -4
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-UKDHGVOC.js +0 -1
- package/dist/standalone/chunk-UPNTMJFF.js +0 -1
- package/dist/standalone/chunk-V43BLH4J.js +0 -1
- package/dist/standalone/chunk-VL23Y44O.js +0 -4
- package/dist/standalone/chunk-VXM5H542.js +0 -4
- package/dist/standalone/chunk-WMDH2CIZ.js +0 -1
- package/dist/standalone/chunk-WVTPZ6CM.js +0 -1
- package/dist/standalone/chunk-XN6QYJQ6.js +0 -13
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-Y4U6CC22.js +0 -1
- package/dist/standalone/chunk-Y572GMZE.js +0 -1
- package/dist/standalone/chunk-Y7PD5KP4.js +0 -76
- package/dist/standalone/chunk-YFIPHCEC.js +0 -1
- package/dist/standalone/chunk-YJXOWLFJ.js +0 -1
- package/dist/standalone/chunk-YNN6NFRZ.js +0 -1
- package/dist/standalone/chunk-YUGHRVPD.js +0 -1
- package/dist/standalone/chunk-ZIGWVHCS.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
- /package/dist/standalone/{chunk-TEWVD66F.js → chunk-GXZAXNZI.js} +0 -0
|
@@ -1,1960 +1 @@
|
|
|
1
|
-
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { useLunora } from '@lunora/react';
|
|
3
|
-
import { useNavigate } from '@tanstack/react-router';
|
|
4
|
-
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
5
|
-
import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
|
|
6
|
-
import { ShardInput } from '../packem_shared/ShardInput-CZnpHILL.js';
|
|
7
|
-
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
8
|
-
import { C as Card, a as CardContent, c as CardHeader, b as CardTitle, d as CardDescription } from '../packem_shared/card-F2vH_aj2.js';
|
|
9
|
-
import { b as TableRow, e as TableCell, T as Table, c as TableHead, a as TableHeader, d as TableBody } from '../packem_shared/table-DsCa9Qp9.js';
|
|
10
|
-
import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
|
|
11
|
-
import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
|
|
12
|
-
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
13
|
-
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
|
|
14
|
-
import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
|
|
15
|
-
import { k as formatBytes, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-DzHCc2Rq.js';
|
|
16
|
-
import { r as recordShard, l as loadRecentShards } from '../packem_shared/shard-history-AxiJ1WPP.js';
|
|
17
|
-
import { w as writePendingTraceFilter } from '../packem_shared/trace-handoff-CGolF3KS.js';
|
|
18
|
-
import { f as formatLogFields } from '../packem_shared/log-fields-jEH83H2G.js';
|
|
19
|
-
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
20
|
-
import { S as Sparkline } from '../packem_shared/sparkline-BnA1kC9X.js';
|
|
21
|
-
import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
|
|
22
|
-
import { aggregateMetrics, computeLatencyPercentiles, enrichQueryStats, shardsToAggregate } from '../packem_shared/aggregateMetrics-D4nUHEKU.js';
|
|
23
|
-
import { b as SelectValue, a as SelectTrigger, d as SelectItem, c as SelectContent, S as Select } from '../packem_shared/select-D9OwHEch.js';
|
|
24
|
-
|
|
25
|
-
const compareKeys = (a, b) => {
|
|
26
|
-
if (a < b) {
|
|
27
|
-
return -1;
|
|
28
|
-
}
|
|
29
|
-
return a > b ? 1 : 0;
|
|
30
|
-
};
|
|
31
|
-
const stableStringify = (value) => {
|
|
32
|
-
if (value === void 0) {
|
|
33
|
-
return "null";
|
|
34
|
-
}
|
|
35
|
-
if (typeof value === "bigint") {
|
|
36
|
-
throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key — pass it as a string, or use stableWireKey");
|
|
37
|
-
}
|
|
38
|
-
if (value === null || typeof value !== "object") {
|
|
39
|
-
return JSON.stringify(value);
|
|
40
|
-
}
|
|
41
|
-
if (Array.isArray(value)) {
|
|
42
|
-
return `[${value.map((item) => stableStringify(item)).join(",")}]`;
|
|
43
|
-
}
|
|
44
|
-
const proto = Object.getPrototypeOf(value);
|
|
45
|
-
if (proto !== null && proto !== Object.prototype) {
|
|
46
|
-
const name = value.constructor?.name ?? "value";
|
|
47
|
-
throw new TypeError(`stableStringify: cannot use a ${name} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`);
|
|
48
|
-
}
|
|
49
|
-
const record = value;
|
|
50
|
-
const keys = Object.keys(record).toSorted(compareKeys);
|
|
51
|
-
const parts = [];
|
|
52
|
-
for (const key of keys) {
|
|
53
|
-
const raw = record[key];
|
|
54
|
-
if (raw === void 0) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
parts.push(`${JSON.stringify(key)}:${stableStringify(raw)}`);
|
|
58
|
-
}
|
|
59
|
-
return `{${parts.join(",")}}`;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const seriesMatchKey = (kind, name, attributes) => `${kind}:${name}:${stableStringify(attributes ?? {})}`;
|
|
63
|
-
const projectByKind = (kind, metric) => {
|
|
64
|
-
if (kind === "gauge") {
|
|
65
|
-
return metric.last;
|
|
66
|
-
}
|
|
67
|
-
if (kind === "histogram") {
|
|
68
|
-
return metric.sum / Math.max(1, metric.count);
|
|
69
|
-
}
|
|
70
|
-
return metric.sum;
|
|
71
|
-
};
|
|
72
|
-
const pointValue = (kind, point) => projectByKind(kind, point);
|
|
73
|
-
const metricHeadline = (series) => projectByKind(series.kind, series);
|
|
74
|
-
const formatMetricValue = (value) => Number.isInteger(value) ? value.toLocaleString() : value.toLocaleString(void 0, {
|
|
75
|
-
maximumFractionDigits: 2
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const seriesOf = (result) => Array.isArray(result?.series) ? result.series : [];
|
|
79
|
-
const historyByKey = (result) => {
|
|
80
|
-
const map = /* @__PURE__ */ new Map();
|
|
81
|
-
if (!Array.isArray(result?.series)) {
|
|
82
|
-
return map;
|
|
83
|
-
}
|
|
84
|
-
for (const entry of result.series) {
|
|
85
|
-
map.set(seriesMatchKey(entry.kind, entry.name, entry.attributes), entry.points);
|
|
86
|
-
}
|
|
87
|
-
return map;
|
|
88
|
-
};
|
|
89
|
-
const KIND_VARIANT = {
|
|
90
|
-
counter: "secondary",
|
|
91
|
-
gauge: "default",
|
|
92
|
-
histogram: "outline"
|
|
93
|
-
};
|
|
94
|
-
const TraceExemplar = (t0) => {
|
|
95
|
-
const $ = c(18);
|
|
96
|
-
const {
|
|
97
|
-
name,
|
|
98
|
-
onOpenTrace,
|
|
99
|
-
traceId
|
|
100
|
-
} = t0;
|
|
101
|
-
const t = useT();
|
|
102
|
-
if (traceId === void 0) {
|
|
103
|
-
let t12;
|
|
104
|
-
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
105
|
-
t12 = /* @__PURE__ */ jsxDEV("span", {
|
|
106
|
-
className: "text-muted-foreground",
|
|
107
|
-
children: "—"
|
|
108
|
-
}, void 0, false);
|
|
109
|
-
$[0] = t12;
|
|
110
|
-
} else {
|
|
111
|
-
t12 = $[0];
|
|
112
|
-
}
|
|
113
|
-
return t12;
|
|
114
|
-
}
|
|
115
|
-
let t1;
|
|
116
|
-
if ($[1] !== traceId) {
|
|
117
|
-
t1 = traceId.slice(0, 8);
|
|
118
|
-
$[1] = traceId;
|
|
119
|
-
$[2] = t1;
|
|
120
|
-
} else {
|
|
121
|
-
t1 = $[2];
|
|
122
|
-
}
|
|
123
|
-
const short = t1;
|
|
124
|
-
if (onOpenTrace === void 0) {
|
|
125
|
-
const t22 = `mt-instrument-trace-${name}`;
|
|
126
|
-
let t32;
|
|
127
|
-
if ($[3] !== short || $[4] !== t22 || $[5] !== traceId) {
|
|
128
|
-
t32 = /* @__PURE__ */ jsxDEV("span", {
|
|
129
|
-
className: "text-muted-foreground",
|
|
130
|
-
"data-testid": t22,
|
|
131
|
-
title: traceId,
|
|
132
|
-
children: short
|
|
133
|
-
}, void 0, false);
|
|
134
|
-
$[3] = short;
|
|
135
|
-
$[4] = t22;
|
|
136
|
-
$[5] = traceId;
|
|
137
|
-
$[6] = t32;
|
|
138
|
-
} else {
|
|
139
|
-
t32 = $[6];
|
|
140
|
-
}
|
|
141
|
-
return t32;
|
|
142
|
-
}
|
|
143
|
-
const t2 = `mt-instrument-trace-${name}`;
|
|
144
|
-
let t3;
|
|
145
|
-
if ($[7] !== onOpenTrace || $[8] !== traceId) {
|
|
146
|
-
t3 = () => {
|
|
147
|
-
onOpenTrace(traceId);
|
|
148
|
-
};
|
|
149
|
-
$[7] = onOpenTrace;
|
|
150
|
-
$[8] = traceId;
|
|
151
|
-
$[9] = t3;
|
|
152
|
-
} else {
|
|
153
|
-
t3 = $[9];
|
|
154
|
-
}
|
|
155
|
-
let t4;
|
|
156
|
-
if ($[10] !== t || $[11] !== traceId) {
|
|
157
|
-
t4 = t("Open the exemplar trace {trace}", {
|
|
158
|
-
trace: traceId
|
|
159
|
-
});
|
|
160
|
-
$[10] = t;
|
|
161
|
-
$[11] = traceId;
|
|
162
|
-
$[12] = t4;
|
|
163
|
-
} else {
|
|
164
|
-
t4 = $[12];
|
|
165
|
-
}
|
|
166
|
-
let t5;
|
|
167
|
-
if ($[13] !== short || $[14] !== t2 || $[15] !== t3 || $[16] !== t4) {
|
|
168
|
-
t5 = /* @__PURE__ */ jsxDEV("button", {
|
|
169
|
-
className: "text-primary underline-offset-4 hover:underline",
|
|
170
|
-
"data-testid": t2,
|
|
171
|
-
onClick: t3,
|
|
172
|
-
title: t4,
|
|
173
|
-
type: "button",
|
|
174
|
-
children: short
|
|
175
|
-
}, void 0, false);
|
|
176
|
-
$[13] = short;
|
|
177
|
-
$[14] = t2;
|
|
178
|
-
$[15] = t3;
|
|
179
|
-
$[16] = t4;
|
|
180
|
-
$[17] = t5;
|
|
181
|
-
} else {
|
|
182
|
-
t5 = $[17];
|
|
183
|
-
}
|
|
184
|
-
return t5;
|
|
185
|
-
};
|
|
186
|
-
const InstrumentsTable = (t0) => {
|
|
187
|
-
const $ = c(92);
|
|
188
|
-
const {
|
|
189
|
-
onOpenTrace,
|
|
190
|
-
shardKey
|
|
191
|
-
} = t0;
|
|
192
|
-
const t = useT();
|
|
193
|
-
let t1;
|
|
194
|
-
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
195
|
-
t1 = {};
|
|
196
|
-
$[0] = t1;
|
|
197
|
-
} else {
|
|
198
|
-
t1 = $[0];
|
|
199
|
-
}
|
|
200
|
-
let t2;
|
|
201
|
-
if ($[1] !== shardKey) {
|
|
202
|
-
t2 = {
|
|
203
|
-
live: true,
|
|
204
|
-
shardKey
|
|
205
|
-
};
|
|
206
|
-
$[1] = shardKey;
|
|
207
|
-
$[2] = t2;
|
|
208
|
-
} else {
|
|
209
|
-
t2 = $[2];
|
|
210
|
-
}
|
|
211
|
-
const {
|
|
212
|
-
data,
|
|
213
|
-
error
|
|
214
|
-
} = useAdminQuery(ADMIN_FUNCTIONS.getMetricSeries, t1, t2);
|
|
215
|
-
let t3;
|
|
216
|
-
if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
217
|
-
t3 = {};
|
|
218
|
-
$[3] = t3;
|
|
219
|
-
} else {
|
|
220
|
-
t3 = $[3];
|
|
221
|
-
}
|
|
222
|
-
let t4;
|
|
223
|
-
if ($[4] !== shardKey) {
|
|
224
|
-
t4 = {
|
|
225
|
-
live: true,
|
|
226
|
-
shardKey
|
|
227
|
-
};
|
|
228
|
-
$[4] = shardKey;
|
|
229
|
-
$[5] = t4;
|
|
230
|
-
} else {
|
|
231
|
-
t4 = $[5];
|
|
232
|
-
}
|
|
233
|
-
const {
|
|
234
|
-
data: history
|
|
235
|
-
} = useAdminQuery(ADMIN_FUNCTIONS.getMetricHistory, t3, t4);
|
|
236
|
-
let T0;
|
|
237
|
-
let T1;
|
|
238
|
-
let T2;
|
|
239
|
-
let T3;
|
|
240
|
-
let t10;
|
|
241
|
-
let t11;
|
|
242
|
-
let t12;
|
|
243
|
-
let t13;
|
|
244
|
-
let t5;
|
|
245
|
-
let t6;
|
|
246
|
-
let t7;
|
|
247
|
-
let t8;
|
|
248
|
-
let t9;
|
|
249
|
-
if ($[6] !== data || $[7] !== error || $[8] !== history || $[9] !== onOpenTrace || $[10] !== t) {
|
|
250
|
-
t13 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
251
|
-
bb0: {
|
|
252
|
-
const series = seriesOf(data);
|
|
253
|
-
if (error !== null || series.length === 0) {
|
|
254
|
-
t13 = null;
|
|
255
|
-
break bb0;
|
|
256
|
-
}
|
|
257
|
-
const trends = historyByKey(history);
|
|
258
|
-
let t142;
|
|
259
|
-
if ($[24] !== t) {
|
|
260
|
-
t142 = (kind) => {
|
|
261
|
-
if (kind === "counter") {
|
|
262
|
-
return t("Counter");
|
|
263
|
-
}
|
|
264
|
-
if (kind === "gauge") {
|
|
265
|
-
return t("Gauge");
|
|
266
|
-
}
|
|
267
|
-
return t("Histogram");
|
|
268
|
-
};
|
|
269
|
-
$[24] = t;
|
|
270
|
-
$[25] = t142;
|
|
271
|
-
} else {
|
|
272
|
-
t142 = $[25];
|
|
273
|
-
}
|
|
274
|
-
const kindLabel = t142;
|
|
275
|
-
t10 = "flex flex-col gap-2";
|
|
276
|
-
t11 = "mt-instruments";
|
|
277
|
-
let t152;
|
|
278
|
-
if ($[26] !== t) {
|
|
279
|
-
t152 = t("Instruments");
|
|
280
|
-
$[26] = t;
|
|
281
|
-
$[27] = t152;
|
|
282
|
-
} else {
|
|
283
|
-
t152 = $[27];
|
|
284
|
-
}
|
|
285
|
-
if ($[28] !== t152) {
|
|
286
|
-
t12 = /* @__PURE__ */ jsxDEV("h3", {
|
|
287
|
-
className: "text-sm font-semibold text-foreground",
|
|
288
|
-
children: t152
|
|
289
|
-
}, void 0, false);
|
|
290
|
-
$[28] = t152;
|
|
291
|
-
$[29] = t12;
|
|
292
|
-
} else {
|
|
293
|
-
t12 = $[29];
|
|
294
|
-
}
|
|
295
|
-
T3 = Card;
|
|
296
|
-
t9 = "overflow-hidden py-0";
|
|
297
|
-
T2 = CardContent;
|
|
298
|
-
t8 = "px-0";
|
|
299
|
-
T1 = Table;
|
|
300
|
-
t6 = "mt-instruments-table";
|
|
301
|
-
let t162;
|
|
302
|
-
if ($[30] !== t) {
|
|
303
|
-
t162 = t("name");
|
|
304
|
-
$[30] = t;
|
|
305
|
-
$[31] = t162;
|
|
306
|
-
} else {
|
|
307
|
-
t162 = $[31];
|
|
308
|
-
}
|
|
309
|
-
let t172;
|
|
310
|
-
if ($[32] !== t162) {
|
|
311
|
-
t172 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
312
|
-
children: t162
|
|
313
|
-
}, void 0, false);
|
|
314
|
-
$[32] = t162;
|
|
315
|
-
$[33] = t172;
|
|
316
|
-
} else {
|
|
317
|
-
t172 = $[33];
|
|
318
|
-
}
|
|
319
|
-
let t182;
|
|
320
|
-
if ($[34] !== t) {
|
|
321
|
-
t182 = t("kind");
|
|
322
|
-
$[34] = t;
|
|
323
|
-
$[35] = t182;
|
|
324
|
-
} else {
|
|
325
|
-
t182 = $[35];
|
|
326
|
-
}
|
|
327
|
-
let t19;
|
|
328
|
-
if ($[36] !== t182) {
|
|
329
|
-
t19 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
330
|
-
children: t182
|
|
331
|
-
}, void 0, false);
|
|
332
|
-
$[36] = t182;
|
|
333
|
-
$[37] = t19;
|
|
334
|
-
} else {
|
|
335
|
-
t19 = $[37];
|
|
336
|
-
}
|
|
337
|
-
let t20;
|
|
338
|
-
if ($[38] !== t) {
|
|
339
|
-
t20 = t("value");
|
|
340
|
-
$[38] = t;
|
|
341
|
-
$[39] = t20;
|
|
342
|
-
} else {
|
|
343
|
-
t20 = $[39];
|
|
344
|
-
}
|
|
345
|
-
let t21;
|
|
346
|
-
if ($[40] !== t20) {
|
|
347
|
-
t21 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
348
|
-
className: "text-right",
|
|
349
|
-
children: t20
|
|
350
|
-
}, void 0, false);
|
|
351
|
-
$[40] = t20;
|
|
352
|
-
$[41] = t21;
|
|
353
|
-
} else {
|
|
354
|
-
t21 = $[41];
|
|
355
|
-
}
|
|
356
|
-
let t22;
|
|
357
|
-
if ($[42] !== t) {
|
|
358
|
-
t22 = t("count");
|
|
359
|
-
$[42] = t;
|
|
360
|
-
$[43] = t22;
|
|
361
|
-
} else {
|
|
362
|
-
t22 = $[43];
|
|
363
|
-
}
|
|
364
|
-
let t23;
|
|
365
|
-
if ($[44] !== t22) {
|
|
366
|
-
t23 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
367
|
-
className: "text-right",
|
|
368
|
-
children: t22
|
|
369
|
-
}, void 0, false);
|
|
370
|
-
$[44] = t22;
|
|
371
|
-
$[45] = t23;
|
|
372
|
-
} else {
|
|
373
|
-
t23 = $[45];
|
|
374
|
-
}
|
|
375
|
-
let t24;
|
|
376
|
-
if ($[46] !== t) {
|
|
377
|
-
t24 = t("range");
|
|
378
|
-
$[46] = t;
|
|
379
|
-
$[47] = t24;
|
|
380
|
-
} else {
|
|
381
|
-
t24 = $[47];
|
|
382
|
-
}
|
|
383
|
-
let t25;
|
|
384
|
-
if ($[48] !== t24) {
|
|
385
|
-
t25 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
386
|
-
className: "text-right",
|
|
387
|
-
children: t24
|
|
388
|
-
}, void 0, false);
|
|
389
|
-
$[48] = t24;
|
|
390
|
-
$[49] = t25;
|
|
391
|
-
} else {
|
|
392
|
-
t25 = $[49];
|
|
393
|
-
}
|
|
394
|
-
let t26;
|
|
395
|
-
if ($[50] !== t) {
|
|
396
|
-
t26 = t("trend");
|
|
397
|
-
$[50] = t;
|
|
398
|
-
$[51] = t26;
|
|
399
|
-
} else {
|
|
400
|
-
t26 = $[51];
|
|
401
|
-
}
|
|
402
|
-
let t27;
|
|
403
|
-
if ($[52] !== t26) {
|
|
404
|
-
t27 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
405
|
-
children: t26
|
|
406
|
-
}, void 0, false);
|
|
407
|
-
$[52] = t26;
|
|
408
|
-
$[53] = t27;
|
|
409
|
-
} else {
|
|
410
|
-
t27 = $[53];
|
|
411
|
-
}
|
|
412
|
-
let t28;
|
|
413
|
-
if ($[54] !== t) {
|
|
414
|
-
t28 = t("trace");
|
|
415
|
-
$[54] = t;
|
|
416
|
-
$[55] = t28;
|
|
417
|
-
} else {
|
|
418
|
-
t28 = $[55];
|
|
419
|
-
}
|
|
420
|
-
let t29;
|
|
421
|
-
if ($[56] !== t28) {
|
|
422
|
-
t29 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
423
|
-
children: t28
|
|
424
|
-
}, void 0, false);
|
|
425
|
-
$[56] = t28;
|
|
426
|
-
$[57] = t29;
|
|
427
|
-
} else {
|
|
428
|
-
t29 = $[57];
|
|
429
|
-
}
|
|
430
|
-
let t30;
|
|
431
|
-
if ($[58] !== t) {
|
|
432
|
-
t30 = t("dimensions");
|
|
433
|
-
$[58] = t;
|
|
434
|
-
$[59] = t30;
|
|
435
|
-
} else {
|
|
436
|
-
t30 = $[59];
|
|
437
|
-
}
|
|
438
|
-
let t31;
|
|
439
|
-
if ($[60] !== t30) {
|
|
440
|
-
t31 = /* @__PURE__ */ jsxDEV(TableHead, {
|
|
441
|
-
children: t30
|
|
442
|
-
}, void 0, false);
|
|
443
|
-
$[60] = t30;
|
|
444
|
-
$[61] = t31;
|
|
445
|
-
} else {
|
|
446
|
-
t31 = $[61];
|
|
447
|
-
}
|
|
448
|
-
if ($[62] !== t172 || $[63] !== t19 || $[64] !== t21 || $[65] !== t23 || $[66] !== t25 || $[67] !== t27 || $[68] !== t29 || $[69] !== t31) {
|
|
449
|
-
t7 = /* @__PURE__ */ jsxDEV(TableHeader, {
|
|
450
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
451
|
-
children: [t172, t19, t21, t23, t25, t27, t29, t31]
|
|
452
|
-
}, void 0, true)
|
|
453
|
-
}, void 0, false);
|
|
454
|
-
$[62] = t172;
|
|
455
|
-
$[63] = t19;
|
|
456
|
-
$[64] = t21;
|
|
457
|
-
$[65] = t23;
|
|
458
|
-
$[66] = t25;
|
|
459
|
-
$[67] = t27;
|
|
460
|
-
$[68] = t29;
|
|
461
|
-
$[69] = t31;
|
|
462
|
-
$[70] = t7;
|
|
463
|
-
} else {
|
|
464
|
-
t7 = $[70];
|
|
465
|
-
}
|
|
466
|
-
T0 = TableBody;
|
|
467
|
-
t5 = series.map((s) => {
|
|
468
|
-
const dimensions = formatLogFields(s.attributes);
|
|
469
|
-
const key = seriesMatchKey(s.kind, s.name, s.attributes);
|
|
470
|
-
const points = trends.get(key) ?? [];
|
|
471
|
-
const trend = points.map((point) => pointValue(s.kind, point));
|
|
472
|
-
return /* @__PURE__ */ jsxDEV(TableRow, {
|
|
473
|
-
"data-testid": `mt-instrument-${s.name}`,
|
|
474
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
475
|
-
className: "font-mono text-xs",
|
|
476
|
-
title: s.functionPath,
|
|
477
|
-
children: s.name
|
|
478
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
479
|
-
children: /* @__PURE__ */ jsxDEV(Badge, {
|
|
480
|
-
variant: KIND_VARIANT[s.kind],
|
|
481
|
-
children: kindLabel(s.kind)
|
|
482
|
-
}, void 0, false)
|
|
483
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
484
|
-
className: "text-right font-mono tabular-nums",
|
|
485
|
-
"data-testid": `mt-instrument-value-${s.name}`,
|
|
486
|
-
children: formatMetricValue(metricHeadline(s))
|
|
487
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
488
|
-
className: "text-right tabular-nums text-muted-foreground",
|
|
489
|
-
children: s.count.toLocaleString()
|
|
490
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
491
|
-
className: "text-right font-mono text-xs tabular-nums text-muted-foreground",
|
|
492
|
-
children: s.min === s.max ? "—" : `${formatMetricValue(s.min)}–${formatMetricValue(s.max)}`
|
|
493
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
494
|
-
children: trend.length >= 2 ? /* @__PURE__ */ jsxDEV(Sparkline, {
|
|
495
|
-
ariaLabel: t("{name} trend", {
|
|
496
|
-
name: s.name
|
|
497
|
-
}),
|
|
498
|
-
className: "h-6 w-24 text-foreground",
|
|
499
|
-
series: trend,
|
|
500
|
-
testId: `mt-instrument-trend-${s.name}`
|
|
501
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV("span", {
|
|
502
|
-
className: "text-xs text-muted-foreground",
|
|
503
|
-
children: "—"
|
|
504
|
-
}, void 0, false)
|
|
505
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
506
|
-
className: "font-mono text-xs",
|
|
507
|
-
children: /* @__PURE__ */ jsxDEV(TraceExemplar, {
|
|
508
|
-
name: s.name,
|
|
509
|
-
onOpenTrace,
|
|
510
|
-
traceId: s.exemplarTraceId
|
|
511
|
-
}, void 0, false)
|
|
512
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
513
|
-
className: "max-w-64 truncate font-mono text-xs text-muted-foreground",
|
|
514
|
-
title: dimensions,
|
|
515
|
-
children: dimensions === "" ? "—" : dimensions
|
|
516
|
-
}, void 0, false)]
|
|
517
|
-
}, key, true);
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
$[6] = data;
|
|
521
|
-
$[7] = error;
|
|
522
|
-
$[8] = history;
|
|
523
|
-
$[9] = onOpenTrace;
|
|
524
|
-
$[10] = t;
|
|
525
|
-
$[11] = T0;
|
|
526
|
-
$[12] = T1;
|
|
527
|
-
$[13] = T2;
|
|
528
|
-
$[14] = T3;
|
|
529
|
-
$[15] = t10;
|
|
530
|
-
$[16] = t11;
|
|
531
|
-
$[17] = t12;
|
|
532
|
-
$[18] = t13;
|
|
533
|
-
$[19] = t5;
|
|
534
|
-
$[20] = t6;
|
|
535
|
-
$[21] = t7;
|
|
536
|
-
$[22] = t8;
|
|
537
|
-
$[23] = t9;
|
|
538
|
-
} else {
|
|
539
|
-
T0 = $[11];
|
|
540
|
-
T1 = $[12];
|
|
541
|
-
T2 = $[13];
|
|
542
|
-
T3 = $[14];
|
|
543
|
-
t10 = $[15];
|
|
544
|
-
t11 = $[16];
|
|
545
|
-
t12 = $[17];
|
|
546
|
-
t13 = $[18];
|
|
547
|
-
t5 = $[19];
|
|
548
|
-
t6 = $[20];
|
|
549
|
-
t7 = $[21];
|
|
550
|
-
t8 = $[22];
|
|
551
|
-
t9 = $[23];
|
|
552
|
-
}
|
|
553
|
-
if (t13 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
|
|
554
|
-
return t13;
|
|
555
|
-
}
|
|
556
|
-
let t14;
|
|
557
|
-
if ($[71] !== T0 || $[72] !== t5) {
|
|
558
|
-
t14 = /* @__PURE__ */ jsxDEV(T0, {
|
|
559
|
-
children: t5
|
|
560
|
-
}, void 0, false);
|
|
561
|
-
$[71] = T0;
|
|
562
|
-
$[72] = t5;
|
|
563
|
-
$[73] = t14;
|
|
564
|
-
} else {
|
|
565
|
-
t14 = $[73];
|
|
566
|
-
}
|
|
567
|
-
let t15;
|
|
568
|
-
if ($[74] !== T1 || $[75] !== t14 || $[76] !== t6 || $[77] !== t7) {
|
|
569
|
-
t15 = /* @__PURE__ */ jsxDEV(T1, {
|
|
570
|
-
"data-testid": t6,
|
|
571
|
-
children: [t7, t14]
|
|
572
|
-
}, void 0, true);
|
|
573
|
-
$[74] = T1;
|
|
574
|
-
$[75] = t14;
|
|
575
|
-
$[76] = t6;
|
|
576
|
-
$[77] = t7;
|
|
577
|
-
$[78] = t15;
|
|
578
|
-
} else {
|
|
579
|
-
t15 = $[78];
|
|
580
|
-
}
|
|
581
|
-
let t16;
|
|
582
|
-
if ($[79] !== T2 || $[80] !== t15 || $[81] !== t8) {
|
|
583
|
-
t16 = /* @__PURE__ */ jsxDEV(T2, {
|
|
584
|
-
className: t8,
|
|
585
|
-
children: t15
|
|
586
|
-
}, void 0, false);
|
|
587
|
-
$[79] = T2;
|
|
588
|
-
$[80] = t15;
|
|
589
|
-
$[81] = t8;
|
|
590
|
-
$[82] = t16;
|
|
591
|
-
} else {
|
|
592
|
-
t16 = $[82];
|
|
593
|
-
}
|
|
594
|
-
let t17;
|
|
595
|
-
if ($[83] !== T3 || $[84] !== t16 || $[85] !== t9) {
|
|
596
|
-
t17 = /* @__PURE__ */ jsxDEV(T3, {
|
|
597
|
-
className: t9,
|
|
598
|
-
children: t16
|
|
599
|
-
}, void 0, false);
|
|
600
|
-
$[83] = T3;
|
|
601
|
-
$[84] = t16;
|
|
602
|
-
$[85] = t9;
|
|
603
|
-
$[86] = t17;
|
|
604
|
-
} else {
|
|
605
|
-
t17 = $[86];
|
|
606
|
-
}
|
|
607
|
-
let t18;
|
|
608
|
-
if ($[87] !== t10 || $[88] !== t11 || $[89] !== t12 || $[90] !== t17) {
|
|
609
|
-
t18 = /* @__PURE__ */ jsxDEV("section", {
|
|
610
|
-
className: t10,
|
|
611
|
-
"data-testid": t11,
|
|
612
|
-
children: [t12, t17]
|
|
613
|
-
}, void 0, true);
|
|
614
|
-
$[87] = t10;
|
|
615
|
-
$[88] = t11;
|
|
616
|
-
$[89] = t12;
|
|
617
|
-
$[90] = t17;
|
|
618
|
-
$[91] = t18;
|
|
619
|
-
} else {
|
|
620
|
-
t18 = $[91];
|
|
621
|
-
}
|
|
622
|
-
return t18;
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
const performanceLevel = (avgMs) => {
|
|
626
|
-
if (avgMs >= 100) {
|
|
627
|
-
return "critical";
|
|
628
|
-
}
|
|
629
|
-
if (avgMs >= 50) {
|
|
630
|
-
return "warning";
|
|
631
|
-
}
|
|
632
|
-
return "good";
|
|
633
|
-
};
|
|
634
|
-
const formatLatency = (ms) => {
|
|
635
|
-
if (ms < 1) {
|
|
636
|
-
return `${(ms * 1e3).toFixed(0)}μs`;
|
|
637
|
-
}
|
|
638
|
-
if (ms < 1e3) {
|
|
639
|
-
return `${ms.toFixed(1)}ms`;
|
|
640
|
-
}
|
|
641
|
-
return `${(ms / 1e3).toFixed(2)}s`;
|
|
642
|
-
};
|
|
643
|
-
const formatCount = (n) => {
|
|
644
|
-
if (n >= 1e9) {
|
|
645
|
-
return `${(n / 1e9).toFixed(1)}B`;
|
|
646
|
-
}
|
|
647
|
-
if (n >= 1e6) {
|
|
648
|
-
return `${(n / 1e6).toFixed(1)}M`;
|
|
649
|
-
}
|
|
650
|
-
if (n >= 1e3) {
|
|
651
|
-
return `${(n / 1e3).toFixed(1)}K`;
|
|
652
|
-
}
|
|
653
|
-
return n.toLocaleString();
|
|
654
|
-
};
|
|
655
|
-
const PerformanceBadge = (t0) => {
|
|
656
|
-
const $ = c(3);
|
|
657
|
-
const {
|
|
658
|
-
level
|
|
659
|
-
} = t0;
|
|
660
|
-
if (level === "critical") {
|
|
661
|
-
let t12;
|
|
662
|
-
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
663
|
-
t12 = /* @__PURE__ */ jsxDEV(Badge, {
|
|
664
|
-
variant: "destructive",
|
|
665
|
-
children: "Slow"
|
|
666
|
-
}, void 0, false);
|
|
667
|
-
$[0] = t12;
|
|
668
|
-
} else {
|
|
669
|
-
t12 = $[0];
|
|
670
|
-
}
|
|
671
|
-
return t12;
|
|
672
|
-
}
|
|
673
|
-
if (level === "warning") {
|
|
674
|
-
let t12;
|
|
675
|
-
if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
676
|
-
t12 = /* @__PURE__ */ jsxDEV("span", {
|
|
677
|
-
className: "inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",
|
|
678
|
-
children: "Moderate"
|
|
679
|
-
}, void 0, false);
|
|
680
|
-
$[1] = t12;
|
|
681
|
-
} else {
|
|
682
|
-
t12 = $[1];
|
|
683
|
-
}
|
|
684
|
-
return t12;
|
|
685
|
-
}
|
|
686
|
-
let t1;
|
|
687
|
-
if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
688
|
-
t1 = /* @__PURE__ */ jsxDEV("span", {
|
|
689
|
-
className: "inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",
|
|
690
|
-
children: "Fast"
|
|
691
|
-
}, void 0, false);
|
|
692
|
-
$[2] = t1;
|
|
693
|
-
} else {
|
|
694
|
-
t1 = $[2];
|
|
695
|
-
}
|
|
696
|
-
return t1;
|
|
697
|
-
};
|
|
698
|
-
const QueryInsights = (t0) => {
|
|
699
|
-
const $ = c(152);
|
|
700
|
-
const {
|
|
701
|
-
queryStats
|
|
702
|
-
} = t0;
|
|
703
|
-
const t = useT();
|
|
704
|
-
const [sortField, setSortField] = useState("totalTime");
|
|
705
|
-
let t1;
|
|
706
|
-
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
707
|
-
t1 = /* @__PURE__ */ new Set();
|
|
708
|
-
$[0] = t1;
|
|
709
|
-
} else {
|
|
710
|
-
t1 = $[0];
|
|
711
|
-
}
|
|
712
|
-
const [expanded, setExpanded] = useState(t1);
|
|
713
|
-
let t2;
|
|
714
|
-
if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
715
|
-
t2 = (value) => {
|
|
716
|
-
if (value !== null) {
|
|
717
|
-
setSortField(value);
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
$[1] = t2;
|
|
721
|
-
} else {
|
|
722
|
-
t2 = $[1];
|
|
723
|
-
}
|
|
724
|
-
const handleSortChange = t2;
|
|
725
|
-
let copy;
|
|
726
|
-
if ($[2] !== queryStats || $[3] !== sortField) {
|
|
727
|
-
copy = [...queryStats];
|
|
728
|
-
let t310;
|
|
729
|
-
if ($[5] !== sortField) {
|
|
730
|
-
t310 = (a, b) => {
|
|
731
|
-
switch (sortField) {
|
|
732
|
-
case "avgTime": {
|
|
733
|
-
return b.avgDurationMs - a.avgDurationMs;
|
|
734
|
-
}
|
|
735
|
-
case "execCount": {
|
|
736
|
-
return b.execCount - a.execCount;
|
|
737
|
-
}
|
|
738
|
-
case "rowsRead": {
|
|
739
|
-
return b.rowsRead - a.rowsRead;
|
|
740
|
-
}
|
|
741
|
-
default: {
|
|
742
|
-
return b.totalDurationMs - a.totalDurationMs;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
};
|
|
746
|
-
$[5] = sortField;
|
|
747
|
-
$[6] = t310;
|
|
748
|
-
} else {
|
|
749
|
-
t310 = $[6];
|
|
750
|
-
}
|
|
751
|
-
copy.sort(t310);
|
|
752
|
-
$[2] = queryStats;
|
|
753
|
-
$[3] = sortField;
|
|
754
|
-
$[4] = copy;
|
|
755
|
-
} else {
|
|
756
|
-
copy = $[4];
|
|
757
|
-
}
|
|
758
|
-
const sorted = copy;
|
|
759
|
-
let t3;
|
|
760
|
-
if ($[7] !== queryStats) {
|
|
761
|
-
t3 = queryStats.filter(_temp);
|
|
762
|
-
$[7] = queryStats;
|
|
763
|
-
$[8] = t3;
|
|
764
|
-
} else {
|
|
765
|
-
t3 = $[8];
|
|
766
|
-
}
|
|
767
|
-
const critical = t3.length;
|
|
768
|
-
let t4;
|
|
769
|
-
if ($[9] !== queryStats) {
|
|
770
|
-
t4 = queryStats.filter(_temp2);
|
|
771
|
-
$[9] = queryStats;
|
|
772
|
-
$[10] = t4;
|
|
773
|
-
} else {
|
|
774
|
-
t4 = $[10];
|
|
775
|
-
}
|
|
776
|
-
const moderate = t4.length;
|
|
777
|
-
let t5;
|
|
778
|
-
if ($[11] !== queryStats) {
|
|
779
|
-
t5 = queryStats.filter(_temp3);
|
|
780
|
-
$[11] = queryStats;
|
|
781
|
-
$[12] = t5;
|
|
782
|
-
} else {
|
|
783
|
-
t5 = $[12];
|
|
784
|
-
}
|
|
785
|
-
const fast = t5.length;
|
|
786
|
-
let t6;
|
|
787
|
-
if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
788
|
-
t6 = (key) => {
|
|
789
|
-
setExpanded((previous) => {
|
|
790
|
-
const next = new Set(previous);
|
|
791
|
-
if (next.has(key)) {
|
|
792
|
-
next.delete(key);
|
|
793
|
-
} else {
|
|
794
|
-
next.add(key);
|
|
795
|
-
}
|
|
796
|
-
return next;
|
|
797
|
-
});
|
|
798
|
-
};
|
|
799
|
-
$[13] = t6;
|
|
800
|
-
} else {
|
|
801
|
-
t6 = $[13];
|
|
802
|
-
}
|
|
803
|
-
const toggleExpand = t6;
|
|
804
|
-
if (queryStats.length === 0) {
|
|
805
|
-
let t72;
|
|
806
|
-
if ($[14] !== t) {
|
|
807
|
-
t72 = t("No query insights yet");
|
|
808
|
-
$[14] = t;
|
|
809
|
-
$[15] = t72;
|
|
810
|
-
} else {
|
|
811
|
-
t72 = $[15];
|
|
812
|
-
}
|
|
813
|
-
let t82;
|
|
814
|
-
if ($[16] !== t72) {
|
|
815
|
-
t82 = /* @__PURE__ */ jsxDEV("p", {
|
|
816
|
-
className: "text-lg font-medium",
|
|
817
|
-
"data-testid": "qi-empty",
|
|
818
|
-
children: t72
|
|
819
|
-
}, void 0, false);
|
|
820
|
-
$[16] = t72;
|
|
821
|
-
$[17] = t82;
|
|
822
|
-
} else {
|
|
823
|
-
t82 = $[17];
|
|
824
|
-
}
|
|
825
|
-
let t92;
|
|
826
|
-
if ($[18] !== t) {
|
|
827
|
-
t92 = t("Query insights appear once statements are executed against this shard.");
|
|
828
|
-
$[18] = t;
|
|
829
|
-
$[19] = t92;
|
|
830
|
-
} else {
|
|
831
|
-
t92 = $[19];
|
|
832
|
-
}
|
|
833
|
-
let t102;
|
|
834
|
-
if ($[20] !== t92) {
|
|
835
|
-
t102 = /* @__PURE__ */ jsxDEV("p", {
|
|
836
|
-
className: "mt-1 text-sm",
|
|
837
|
-
children: t92
|
|
838
|
-
}, void 0, false);
|
|
839
|
-
$[20] = t92;
|
|
840
|
-
$[21] = t102;
|
|
841
|
-
} else {
|
|
842
|
-
t102 = $[21];
|
|
843
|
-
}
|
|
844
|
-
let t112;
|
|
845
|
-
if ($[22] !== t102 || $[23] !== t82) {
|
|
846
|
-
t112 = /* @__PURE__ */ jsxDEV(Card, {
|
|
847
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
848
|
-
className: "py-12",
|
|
849
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
850
|
-
className: "text-center text-muted-foreground",
|
|
851
|
-
children: [t82, t102]
|
|
852
|
-
}, void 0, true)
|
|
853
|
-
}, void 0, false)
|
|
854
|
-
}, void 0, false);
|
|
855
|
-
$[22] = t102;
|
|
856
|
-
$[23] = t82;
|
|
857
|
-
$[24] = t112;
|
|
858
|
-
} else {
|
|
859
|
-
t112 = $[24];
|
|
860
|
-
}
|
|
861
|
-
return t112;
|
|
862
|
-
}
|
|
863
|
-
let t7;
|
|
864
|
-
if ($[25] !== t) {
|
|
865
|
-
t7 = t("Critical queries");
|
|
866
|
-
$[25] = t;
|
|
867
|
-
$[26] = t7;
|
|
868
|
-
} else {
|
|
869
|
-
t7 = $[26];
|
|
870
|
-
}
|
|
871
|
-
let t8;
|
|
872
|
-
if ($[27] !== t7) {
|
|
873
|
-
t8 = /* @__PURE__ */ jsxDEV(CardHeader, {
|
|
874
|
-
className: "pb-2",
|
|
875
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
876
|
-
className: "text-sm font-medium",
|
|
877
|
-
children: t7
|
|
878
|
-
}, void 0, false)
|
|
879
|
-
}, void 0, false);
|
|
880
|
-
$[27] = t7;
|
|
881
|
-
$[28] = t8;
|
|
882
|
-
} else {
|
|
883
|
-
t8 = $[28];
|
|
884
|
-
}
|
|
885
|
-
let t9;
|
|
886
|
-
if ($[29] !== critical) {
|
|
887
|
-
t9 = /* @__PURE__ */ jsxDEV("div", {
|
|
888
|
-
className: "text-2xl font-bold text-destructive",
|
|
889
|
-
"data-testid": "qi-critical",
|
|
890
|
-
children: critical
|
|
891
|
-
}, void 0, false);
|
|
892
|
-
$[29] = critical;
|
|
893
|
-
$[30] = t9;
|
|
894
|
-
} else {
|
|
895
|
-
t9 = $[30];
|
|
896
|
-
}
|
|
897
|
-
let t10;
|
|
898
|
-
if ($[31] !== t) {
|
|
899
|
-
t10 = t(">100ms avg execution");
|
|
900
|
-
$[31] = t;
|
|
901
|
-
$[32] = t10;
|
|
902
|
-
} else {
|
|
903
|
-
t10 = $[32];
|
|
904
|
-
}
|
|
905
|
-
let t11;
|
|
906
|
-
if ($[33] !== t10) {
|
|
907
|
-
t11 = /* @__PURE__ */ jsxDEV("p", {
|
|
908
|
-
className: "text-xs text-muted-foreground",
|
|
909
|
-
children: t10
|
|
910
|
-
}, void 0, false);
|
|
911
|
-
$[33] = t10;
|
|
912
|
-
$[34] = t11;
|
|
913
|
-
} else {
|
|
914
|
-
t11 = $[34];
|
|
915
|
-
}
|
|
916
|
-
let t12;
|
|
917
|
-
if ($[35] !== t11 || $[36] !== t9) {
|
|
918
|
-
t12 = /* @__PURE__ */ jsxDEV(CardContent, {
|
|
919
|
-
children: [t9, t11]
|
|
920
|
-
}, void 0, true);
|
|
921
|
-
$[35] = t11;
|
|
922
|
-
$[36] = t9;
|
|
923
|
-
$[37] = t12;
|
|
924
|
-
} else {
|
|
925
|
-
t12 = $[37];
|
|
926
|
-
}
|
|
927
|
-
let t13;
|
|
928
|
-
if ($[38] !== t12 || $[39] !== t8) {
|
|
929
|
-
t13 = /* @__PURE__ */ jsxDEV(Card, {
|
|
930
|
-
children: [t8, t12]
|
|
931
|
-
}, void 0, true);
|
|
932
|
-
$[38] = t12;
|
|
933
|
-
$[39] = t8;
|
|
934
|
-
$[40] = t13;
|
|
935
|
-
} else {
|
|
936
|
-
t13 = $[40];
|
|
937
|
-
}
|
|
938
|
-
let t14;
|
|
939
|
-
if ($[41] !== t) {
|
|
940
|
-
t14 = t("Moderate queries");
|
|
941
|
-
$[41] = t;
|
|
942
|
-
$[42] = t14;
|
|
943
|
-
} else {
|
|
944
|
-
t14 = $[42];
|
|
945
|
-
}
|
|
946
|
-
let t15;
|
|
947
|
-
if ($[43] !== t14) {
|
|
948
|
-
t15 = /* @__PURE__ */ jsxDEV(CardHeader, {
|
|
949
|
-
className: "pb-2",
|
|
950
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
951
|
-
className: "text-sm font-medium",
|
|
952
|
-
children: t14
|
|
953
|
-
}, void 0, false)
|
|
954
|
-
}, void 0, false);
|
|
955
|
-
$[43] = t14;
|
|
956
|
-
$[44] = t15;
|
|
957
|
-
} else {
|
|
958
|
-
t15 = $[44];
|
|
959
|
-
}
|
|
960
|
-
let t16;
|
|
961
|
-
if ($[45] !== moderate) {
|
|
962
|
-
t16 = /* @__PURE__ */ jsxDEV("div", {
|
|
963
|
-
className: "text-2xl font-bold text-warning",
|
|
964
|
-
"data-testid": "qi-moderate",
|
|
965
|
-
children: moderate
|
|
966
|
-
}, void 0, false);
|
|
967
|
-
$[45] = moderate;
|
|
968
|
-
$[46] = t16;
|
|
969
|
-
} else {
|
|
970
|
-
t16 = $[46];
|
|
971
|
-
}
|
|
972
|
-
let t17;
|
|
973
|
-
if ($[47] !== t) {
|
|
974
|
-
t17 = t("50–100ms avg execution");
|
|
975
|
-
$[47] = t;
|
|
976
|
-
$[48] = t17;
|
|
977
|
-
} else {
|
|
978
|
-
t17 = $[48];
|
|
979
|
-
}
|
|
980
|
-
let t18;
|
|
981
|
-
if ($[49] !== t17) {
|
|
982
|
-
t18 = /* @__PURE__ */ jsxDEV("p", {
|
|
983
|
-
className: "text-xs text-muted-foreground",
|
|
984
|
-
children: t17
|
|
985
|
-
}, void 0, false);
|
|
986
|
-
$[49] = t17;
|
|
987
|
-
$[50] = t18;
|
|
988
|
-
} else {
|
|
989
|
-
t18 = $[50];
|
|
990
|
-
}
|
|
991
|
-
let t19;
|
|
992
|
-
if ($[51] !== t16 || $[52] !== t18) {
|
|
993
|
-
t19 = /* @__PURE__ */ jsxDEV(CardContent, {
|
|
994
|
-
children: [t16, t18]
|
|
995
|
-
}, void 0, true);
|
|
996
|
-
$[51] = t16;
|
|
997
|
-
$[52] = t18;
|
|
998
|
-
$[53] = t19;
|
|
999
|
-
} else {
|
|
1000
|
-
t19 = $[53];
|
|
1001
|
-
}
|
|
1002
|
-
let t20;
|
|
1003
|
-
if ($[54] !== t15 || $[55] !== t19) {
|
|
1004
|
-
t20 = /* @__PURE__ */ jsxDEV(Card, {
|
|
1005
|
-
children: [t15, t19]
|
|
1006
|
-
}, void 0, true);
|
|
1007
|
-
$[54] = t15;
|
|
1008
|
-
$[55] = t19;
|
|
1009
|
-
$[56] = t20;
|
|
1010
|
-
} else {
|
|
1011
|
-
t20 = $[56];
|
|
1012
|
-
}
|
|
1013
|
-
let t21;
|
|
1014
|
-
if ($[57] !== t) {
|
|
1015
|
-
t21 = t("Fast queries");
|
|
1016
|
-
$[57] = t;
|
|
1017
|
-
$[58] = t21;
|
|
1018
|
-
} else {
|
|
1019
|
-
t21 = $[58];
|
|
1020
|
-
}
|
|
1021
|
-
let t22;
|
|
1022
|
-
if ($[59] !== t21) {
|
|
1023
|
-
t22 = /* @__PURE__ */ jsxDEV(CardHeader, {
|
|
1024
|
-
className: "pb-2",
|
|
1025
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
1026
|
-
className: "text-sm font-medium",
|
|
1027
|
-
children: t21
|
|
1028
|
-
}, void 0, false)
|
|
1029
|
-
}, void 0, false);
|
|
1030
|
-
$[59] = t21;
|
|
1031
|
-
$[60] = t22;
|
|
1032
|
-
} else {
|
|
1033
|
-
t22 = $[60];
|
|
1034
|
-
}
|
|
1035
|
-
let t23;
|
|
1036
|
-
if ($[61] !== fast) {
|
|
1037
|
-
t23 = /* @__PURE__ */ jsxDEV("div", {
|
|
1038
|
-
className: "text-2xl font-bold text-success",
|
|
1039
|
-
"data-testid": "qi-fast",
|
|
1040
|
-
children: fast
|
|
1041
|
-
}, void 0, false);
|
|
1042
|
-
$[61] = fast;
|
|
1043
|
-
$[62] = t23;
|
|
1044
|
-
} else {
|
|
1045
|
-
t23 = $[62];
|
|
1046
|
-
}
|
|
1047
|
-
let t24;
|
|
1048
|
-
if ($[63] !== t) {
|
|
1049
|
-
t24 = t("<50ms avg execution");
|
|
1050
|
-
$[63] = t;
|
|
1051
|
-
$[64] = t24;
|
|
1052
|
-
} else {
|
|
1053
|
-
t24 = $[64];
|
|
1054
|
-
}
|
|
1055
|
-
let t25;
|
|
1056
|
-
if ($[65] !== t24) {
|
|
1057
|
-
t25 = /* @__PURE__ */ jsxDEV("p", {
|
|
1058
|
-
className: "text-xs text-muted-foreground",
|
|
1059
|
-
children: t24
|
|
1060
|
-
}, void 0, false);
|
|
1061
|
-
$[65] = t24;
|
|
1062
|
-
$[66] = t25;
|
|
1063
|
-
} else {
|
|
1064
|
-
t25 = $[66];
|
|
1065
|
-
}
|
|
1066
|
-
let t26;
|
|
1067
|
-
if ($[67] !== t23 || $[68] !== t25) {
|
|
1068
|
-
t26 = /* @__PURE__ */ jsxDEV(CardContent, {
|
|
1069
|
-
children: [t23, t25]
|
|
1070
|
-
}, void 0, true);
|
|
1071
|
-
$[67] = t23;
|
|
1072
|
-
$[68] = t25;
|
|
1073
|
-
$[69] = t26;
|
|
1074
|
-
} else {
|
|
1075
|
-
t26 = $[69];
|
|
1076
|
-
}
|
|
1077
|
-
let t27;
|
|
1078
|
-
if ($[70] !== t22 || $[71] !== t26) {
|
|
1079
|
-
t27 = /* @__PURE__ */ jsxDEV(Card, {
|
|
1080
|
-
children: [t22, t26]
|
|
1081
|
-
}, void 0, true);
|
|
1082
|
-
$[70] = t22;
|
|
1083
|
-
$[71] = t26;
|
|
1084
|
-
$[72] = t27;
|
|
1085
|
-
} else {
|
|
1086
|
-
t27 = $[72];
|
|
1087
|
-
}
|
|
1088
|
-
let t28;
|
|
1089
|
-
if ($[73] !== t13 || $[74] !== t20 || $[75] !== t27) {
|
|
1090
|
-
t28 = /* @__PURE__ */ jsxDEV("div", {
|
|
1091
|
-
className: "grid gap-4 md:grid-cols-3",
|
|
1092
|
-
children: [t13, t20, t27]
|
|
1093
|
-
}, void 0, true);
|
|
1094
|
-
$[73] = t13;
|
|
1095
|
-
$[74] = t20;
|
|
1096
|
-
$[75] = t27;
|
|
1097
|
-
$[76] = t28;
|
|
1098
|
-
} else {
|
|
1099
|
-
t28 = $[76];
|
|
1100
|
-
}
|
|
1101
|
-
let t29;
|
|
1102
|
-
if ($[77] !== t) {
|
|
1103
|
-
t29 = t("Query leaderboard");
|
|
1104
|
-
$[77] = t;
|
|
1105
|
-
$[78] = t29;
|
|
1106
|
-
} else {
|
|
1107
|
-
t29 = $[78];
|
|
1108
|
-
}
|
|
1109
|
-
let t30;
|
|
1110
|
-
if ($[79] !== t29) {
|
|
1111
|
-
t30 = /* @__PURE__ */ jsxDEV("h3", {
|
|
1112
|
-
className: "text-lg font-semibold",
|
|
1113
|
-
children: t29
|
|
1114
|
-
}, void 0, false);
|
|
1115
|
-
$[79] = t29;
|
|
1116
|
-
$[80] = t30;
|
|
1117
|
-
} else {
|
|
1118
|
-
t30 = $[80];
|
|
1119
|
-
}
|
|
1120
|
-
let t31;
|
|
1121
|
-
if ($[81] !== sortField || $[82] !== t) {
|
|
1122
|
-
t31 = t("Slow queries sorted by {sortField}", {
|
|
1123
|
-
sortField: t(sortField)
|
|
1124
|
-
});
|
|
1125
|
-
$[81] = sortField;
|
|
1126
|
-
$[82] = t;
|
|
1127
|
-
$[83] = t31;
|
|
1128
|
-
} else {
|
|
1129
|
-
t31 = $[83];
|
|
1130
|
-
}
|
|
1131
|
-
let t32;
|
|
1132
|
-
if ($[84] !== t31) {
|
|
1133
|
-
t32 = /* @__PURE__ */ jsxDEV("p", {
|
|
1134
|
-
className: "text-sm text-muted-foreground",
|
|
1135
|
-
children: t31
|
|
1136
|
-
}, void 0, false);
|
|
1137
|
-
$[84] = t31;
|
|
1138
|
-
$[85] = t32;
|
|
1139
|
-
} else {
|
|
1140
|
-
t32 = $[85];
|
|
1141
|
-
}
|
|
1142
|
-
let t33;
|
|
1143
|
-
if ($[86] !== t30 || $[87] !== t32) {
|
|
1144
|
-
t33 = /* @__PURE__ */ jsxDEV("div", {
|
|
1145
|
-
children: [t30, t32]
|
|
1146
|
-
}, void 0, true);
|
|
1147
|
-
$[86] = t30;
|
|
1148
|
-
$[87] = t32;
|
|
1149
|
-
$[88] = t33;
|
|
1150
|
-
} else {
|
|
1151
|
-
t33 = $[88];
|
|
1152
|
-
}
|
|
1153
|
-
let t34;
|
|
1154
|
-
if ($[89] !== t) {
|
|
1155
|
-
t34 = t("Sort by");
|
|
1156
|
-
$[89] = t;
|
|
1157
|
-
$[90] = t34;
|
|
1158
|
-
} else {
|
|
1159
|
-
t34 = $[90];
|
|
1160
|
-
}
|
|
1161
|
-
let t35;
|
|
1162
|
-
if ($[91] !== t34) {
|
|
1163
|
-
t35 = /* @__PURE__ */ jsxDEV("span", {
|
|
1164
|
-
className: "text-sm text-muted-foreground",
|
|
1165
|
-
children: t34
|
|
1166
|
-
}, void 0, false);
|
|
1167
|
-
$[91] = t34;
|
|
1168
|
-
$[92] = t35;
|
|
1169
|
-
} else {
|
|
1170
|
-
t35 = $[92];
|
|
1171
|
-
}
|
|
1172
|
-
let t36;
|
|
1173
|
-
if ($[93] !== t) {
|
|
1174
|
-
t36 = t("Sort queries by");
|
|
1175
|
-
$[93] = t;
|
|
1176
|
-
$[94] = t36;
|
|
1177
|
-
} else {
|
|
1178
|
-
t36 = $[94];
|
|
1179
|
-
}
|
|
1180
|
-
let t37;
|
|
1181
|
-
if ($[95] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1182
|
-
t37 = /* @__PURE__ */ jsxDEV(SelectValue, {}, void 0, false);
|
|
1183
|
-
$[95] = t37;
|
|
1184
|
-
} else {
|
|
1185
|
-
t37 = $[95];
|
|
1186
|
-
}
|
|
1187
|
-
let t38;
|
|
1188
|
-
if ($[96] !== t36) {
|
|
1189
|
-
t38 = /* @__PURE__ */ jsxDEV(SelectTrigger, {
|
|
1190
|
-
"aria-label": t36,
|
|
1191
|
-
className: "w-[140px]",
|
|
1192
|
-
"data-testid": "qi-sort",
|
|
1193
|
-
children: t37
|
|
1194
|
-
}, void 0, false);
|
|
1195
|
-
$[96] = t36;
|
|
1196
|
-
$[97] = t38;
|
|
1197
|
-
} else {
|
|
1198
|
-
t38 = $[97];
|
|
1199
|
-
}
|
|
1200
|
-
let t39;
|
|
1201
|
-
if ($[98] !== t) {
|
|
1202
|
-
t39 = t("Total time");
|
|
1203
|
-
$[98] = t;
|
|
1204
|
-
$[99] = t39;
|
|
1205
|
-
} else {
|
|
1206
|
-
t39 = $[99];
|
|
1207
|
-
}
|
|
1208
|
-
let t40;
|
|
1209
|
-
if ($[100] !== t39) {
|
|
1210
|
-
t40 = /* @__PURE__ */ jsxDEV(SelectItem, {
|
|
1211
|
-
value: "totalTime",
|
|
1212
|
-
children: t39
|
|
1213
|
-
}, void 0, false);
|
|
1214
|
-
$[100] = t39;
|
|
1215
|
-
$[101] = t40;
|
|
1216
|
-
} else {
|
|
1217
|
-
t40 = $[101];
|
|
1218
|
-
}
|
|
1219
|
-
let t41;
|
|
1220
|
-
if ($[102] !== t) {
|
|
1221
|
-
t41 = t("Avg time");
|
|
1222
|
-
$[102] = t;
|
|
1223
|
-
$[103] = t41;
|
|
1224
|
-
} else {
|
|
1225
|
-
t41 = $[103];
|
|
1226
|
-
}
|
|
1227
|
-
let t42;
|
|
1228
|
-
if ($[104] !== t41) {
|
|
1229
|
-
t42 = /* @__PURE__ */ jsxDEV(SelectItem, {
|
|
1230
|
-
value: "avgTime",
|
|
1231
|
-
children: t41
|
|
1232
|
-
}, void 0, false);
|
|
1233
|
-
$[104] = t41;
|
|
1234
|
-
$[105] = t42;
|
|
1235
|
-
} else {
|
|
1236
|
-
t42 = $[105];
|
|
1237
|
-
}
|
|
1238
|
-
let t43;
|
|
1239
|
-
if ($[106] !== t) {
|
|
1240
|
-
t43 = t("Execution count");
|
|
1241
|
-
$[106] = t;
|
|
1242
|
-
$[107] = t43;
|
|
1243
|
-
} else {
|
|
1244
|
-
t43 = $[107];
|
|
1245
|
-
}
|
|
1246
|
-
let t44;
|
|
1247
|
-
if ($[108] !== t43) {
|
|
1248
|
-
t44 = /* @__PURE__ */ jsxDEV(SelectItem, {
|
|
1249
|
-
value: "execCount",
|
|
1250
|
-
children: t43
|
|
1251
|
-
}, void 0, false);
|
|
1252
|
-
$[108] = t43;
|
|
1253
|
-
$[109] = t44;
|
|
1254
|
-
} else {
|
|
1255
|
-
t44 = $[109];
|
|
1256
|
-
}
|
|
1257
|
-
let t45;
|
|
1258
|
-
if ($[110] !== t) {
|
|
1259
|
-
t45 = t("Rows read");
|
|
1260
|
-
$[110] = t;
|
|
1261
|
-
$[111] = t45;
|
|
1262
|
-
} else {
|
|
1263
|
-
t45 = $[111];
|
|
1264
|
-
}
|
|
1265
|
-
let t46;
|
|
1266
|
-
if ($[112] !== t45) {
|
|
1267
|
-
t46 = /* @__PURE__ */ jsxDEV(SelectItem, {
|
|
1268
|
-
value: "rowsRead",
|
|
1269
|
-
children: t45
|
|
1270
|
-
}, void 0, false);
|
|
1271
|
-
$[112] = t45;
|
|
1272
|
-
$[113] = t46;
|
|
1273
|
-
} else {
|
|
1274
|
-
t46 = $[113];
|
|
1275
|
-
}
|
|
1276
|
-
let t47;
|
|
1277
|
-
if ($[114] !== t40 || $[115] !== t42 || $[116] !== t44 || $[117] !== t46) {
|
|
1278
|
-
t47 = /* @__PURE__ */ jsxDEV(SelectContent, {
|
|
1279
|
-
children: [t40, t42, t44, t46]
|
|
1280
|
-
}, void 0, true);
|
|
1281
|
-
$[114] = t40;
|
|
1282
|
-
$[115] = t42;
|
|
1283
|
-
$[116] = t44;
|
|
1284
|
-
$[117] = t46;
|
|
1285
|
-
$[118] = t47;
|
|
1286
|
-
} else {
|
|
1287
|
-
t47 = $[118];
|
|
1288
|
-
}
|
|
1289
|
-
let t48;
|
|
1290
|
-
if ($[119] !== sortField || $[120] !== t38 || $[121] !== t47) {
|
|
1291
|
-
t48 = /* @__PURE__ */ jsxDEV(Select, {
|
|
1292
|
-
onValueChange: handleSortChange,
|
|
1293
|
-
value: sortField,
|
|
1294
|
-
children: [t38, t47]
|
|
1295
|
-
}, void 0, true);
|
|
1296
|
-
$[119] = sortField;
|
|
1297
|
-
$[120] = t38;
|
|
1298
|
-
$[121] = t47;
|
|
1299
|
-
$[122] = t48;
|
|
1300
|
-
} else {
|
|
1301
|
-
t48 = $[122];
|
|
1302
|
-
}
|
|
1303
|
-
let t49;
|
|
1304
|
-
if ($[123] !== t35 || $[124] !== t48) {
|
|
1305
|
-
t49 = /* @__PURE__ */ jsxDEV("div", {
|
|
1306
|
-
className: "flex items-center gap-2",
|
|
1307
|
-
children: [t35, t48]
|
|
1308
|
-
}, void 0, true);
|
|
1309
|
-
$[123] = t35;
|
|
1310
|
-
$[124] = t48;
|
|
1311
|
-
$[125] = t49;
|
|
1312
|
-
} else {
|
|
1313
|
-
t49 = $[125];
|
|
1314
|
-
}
|
|
1315
|
-
let t50;
|
|
1316
|
-
if ($[126] !== t33 || $[127] !== t49) {
|
|
1317
|
-
t50 = /* @__PURE__ */ jsxDEV("div", {
|
|
1318
|
-
className: "flex items-center justify-between",
|
|
1319
|
-
children: [t33, t49]
|
|
1320
|
-
}, void 0, true);
|
|
1321
|
-
$[126] = t33;
|
|
1322
|
-
$[127] = t49;
|
|
1323
|
-
$[128] = t50;
|
|
1324
|
-
} else {
|
|
1325
|
-
t50 = $[128];
|
|
1326
|
-
}
|
|
1327
|
-
let t51;
|
|
1328
|
-
if ($[129] !== t) {
|
|
1329
|
-
t51 = t("Statements");
|
|
1330
|
-
$[129] = t;
|
|
1331
|
-
$[130] = t51;
|
|
1332
|
-
} else {
|
|
1333
|
-
t51 = $[130];
|
|
1334
|
-
}
|
|
1335
|
-
let t52;
|
|
1336
|
-
if ($[131] !== t51) {
|
|
1337
|
-
t52 = /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
1338
|
-
children: t51
|
|
1339
|
-
}, void 0, false);
|
|
1340
|
-
$[131] = t51;
|
|
1341
|
-
$[132] = t52;
|
|
1342
|
-
} else {
|
|
1343
|
-
t52 = $[132];
|
|
1344
|
-
}
|
|
1345
|
-
let t53;
|
|
1346
|
-
if ($[133] !== sorted.length || $[134] !== t) {
|
|
1347
|
-
t53 = t("{count} tracked statements", {
|
|
1348
|
-
count: sorted.length
|
|
1349
|
-
});
|
|
1350
|
-
$[133] = sorted.length;
|
|
1351
|
-
$[134] = t;
|
|
1352
|
-
$[135] = t53;
|
|
1353
|
-
} else {
|
|
1354
|
-
t53 = $[135];
|
|
1355
|
-
}
|
|
1356
|
-
let t54;
|
|
1357
|
-
if ($[136] !== t53) {
|
|
1358
|
-
t54 = /* @__PURE__ */ jsxDEV(CardDescription, {
|
|
1359
|
-
children: t53
|
|
1360
|
-
}, void 0, false);
|
|
1361
|
-
$[136] = t53;
|
|
1362
|
-
$[137] = t54;
|
|
1363
|
-
} else {
|
|
1364
|
-
t54 = $[137];
|
|
1365
|
-
}
|
|
1366
|
-
let t55;
|
|
1367
|
-
if ($[138] !== t52 || $[139] !== t54) {
|
|
1368
|
-
t55 = /* @__PURE__ */ jsxDEV(CardHeader, {
|
|
1369
|
-
children: [t52, t54]
|
|
1370
|
-
}, void 0, true);
|
|
1371
|
-
$[138] = t52;
|
|
1372
|
-
$[139] = t54;
|
|
1373
|
-
$[140] = t55;
|
|
1374
|
-
} else {
|
|
1375
|
-
t55 = $[140];
|
|
1376
|
-
}
|
|
1377
|
-
let t56;
|
|
1378
|
-
if ($[141] !== expanded || $[142] !== sorted || $[143] !== t) {
|
|
1379
|
-
t56 = /* @__PURE__ */ jsxDEV(CardContent, {
|
|
1380
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
1381
|
-
className: "space-y-2",
|
|
1382
|
-
children: sorted.map((stat) => {
|
|
1383
|
-
const key_0 = stat.normalizedSql;
|
|
1384
|
-
const isExpanded = expanded.has(key_0);
|
|
1385
|
-
const level = performanceLevel(stat.avgDurationMs);
|
|
1386
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
1387
|
-
className: "overflow-hidden rounded-lg border",
|
|
1388
|
-
"data-testid": "qi-row",
|
|
1389
|
-
children: [/* @__PURE__ */ jsxDEV("button", {
|
|
1390
|
-
"aria-expanded": isExpanded,
|
|
1391
|
-
className: "flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",
|
|
1392
|
-
onClick: () => {
|
|
1393
|
-
toggleExpand(key_0);
|
|
1394
|
-
},
|
|
1395
|
-
type: "button",
|
|
1396
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1397
|
-
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1398
|
-
children: [/* @__PURE__ */ jsxDEV(PerformanceBadge, {
|
|
1399
|
-
level
|
|
1400
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
1401
|
-
className: "max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",
|
|
1402
|
-
children: stat.normalizedSql
|
|
1403
|
-
}, void 0, false)]
|
|
1404
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1405
|
-
className: "flex shrink-0 items-center gap-4",
|
|
1406
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1407
|
-
className: "text-right",
|
|
1408
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1409
|
-
className: "text-sm font-medium",
|
|
1410
|
-
children: formatLatency(stat.totalDurationMs)
|
|
1411
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
1412
|
-
className: "text-xs text-muted-foreground",
|
|
1413
|
-
children: t("total")
|
|
1414
|
-
}, void 0, false)]
|
|
1415
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1416
|
-
className: "text-right",
|
|
1417
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1418
|
-
className: "text-sm font-medium",
|
|
1419
|
-
children: formatLatency(stat.avgDurationMs)
|
|
1420
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
1421
|
-
className: "text-xs text-muted-foreground",
|
|
1422
|
-
children: t("avg")
|
|
1423
|
-
}, void 0, false)]
|
|
1424
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1425
|
-
className: "text-right",
|
|
1426
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1427
|
-
className: "text-sm font-medium",
|
|
1428
|
-
children: formatCount(stat.execCount)
|
|
1429
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
1430
|
-
className: "text-xs text-muted-foreground",
|
|
1431
|
-
children: t("calls")
|
|
1432
|
-
}, void 0, false)]
|
|
1433
|
-
}, void 0, true)]
|
|
1434
|
-
}, void 0, true)]
|
|
1435
|
-
}, void 0, true), isExpanded && /* @__PURE__ */ jsxDEV("div", {
|
|
1436
|
-
className: "space-y-3 border-t bg-muted/30 p-4",
|
|
1437
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1438
|
-
children: [/* @__PURE__ */ jsxDEV("p", {
|
|
1439
|
-
className: "mb-2 text-sm font-medium",
|
|
1440
|
-
children: t("Full statement")
|
|
1441
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("pre", {
|
|
1442
|
-
className: "overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",
|
|
1443
|
-
children: stat.normalizedSql
|
|
1444
|
-
}, void 0, false)]
|
|
1445
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1446
|
-
className: "grid grid-cols-2 gap-4 text-sm md:grid-cols-4",
|
|
1447
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1448
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1449
|
-
className: "text-muted-foreground",
|
|
1450
|
-
children: t("Exec count")
|
|
1451
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
1452
|
-
className: "block font-medium tabular-nums",
|
|
1453
|
-
children: formatCount(stat.execCount)
|
|
1454
|
-
}, void 0, false)]
|
|
1455
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1456
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1457
|
-
className: "text-muted-foreground",
|
|
1458
|
-
children: t("Total time")
|
|
1459
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
1460
|
-
className: "block font-medium tabular-nums",
|
|
1461
|
-
children: formatLatency(stat.totalDurationMs)
|
|
1462
|
-
}, void 0, false)]
|
|
1463
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1464
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1465
|
-
className: "text-muted-foreground",
|
|
1466
|
-
children: t("Rows read")
|
|
1467
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
1468
|
-
className: "block font-medium tabular-nums",
|
|
1469
|
-
children: formatCount(stat.rowsRead)
|
|
1470
|
-
}, void 0, false)]
|
|
1471
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
1472
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1473
|
-
className: "text-muted-foreground",
|
|
1474
|
-
children: t("Rows written")
|
|
1475
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
1476
|
-
className: "block font-medium tabular-nums",
|
|
1477
|
-
children: formatCount(stat.rowsWritten)
|
|
1478
|
-
}, void 0, false)]
|
|
1479
|
-
}, void 0, true)]
|
|
1480
|
-
}, void 0, true)]
|
|
1481
|
-
}, void 0, true)]
|
|
1482
|
-
}, key_0, true);
|
|
1483
|
-
})
|
|
1484
|
-
}, void 0, false)
|
|
1485
|
-
}, void 0, false);
|
|
1486
|
-
$[141] = expanded;
|
|
1487
|
-
$[142] = sorted;
|
|
1488
|
-
$[143] = t;
|
|
1489
|
-
$[144] = t56;
|
|
1490
|
-
} else {
|
|
1491
|
-
t56 = $[144];
|
|
1492
|
-
}
|
|
1493
|
-
let t57;
|
|
1494
|
-
if ($[145] !== t55 || $[146] !== t56) {
|
|
1495
|
-
t57 = /* @__PURE__ */ jsxDEV(Card, {
|
|
1496
|
-
children: [t55, t56]
|
|
1497
|
-
}, void 0, true);
|
|
1498
|
-
$[145] = t55;
|
|
1499
|
-
$[146] = t56;
|
|
1500
|
-
$[147] = t57;
|
|
1501
|
-
} else {
|
|
1502
|
-
t57 = $[147];
|
|
1503
|
-
}
|
|
1504
|
-
let t58;
|
|
1505
|
-
if ($[148] !== t28 || $[149] !== t50 || $[150] !== t57) {
|
|
1506
|
-
t58 = /* @__PURE__ */ jsxDEV("div", {
|
|
1507
|
-
className: "space-y-4",
|
|
1508
|
-
"data-testid": "qi-root",
|
|
1509
|
-
children: [t28, t50, t57]
|
|
1510
|
-
}, void 0, true);
|
|
1511
|
-
$[148] = t28;
|
|
1512
|
-
$[149] = t50;
|
|
1513
|
-
$[150] = t57;
|
|
1514
|
-
$[151] = t58;
|
|
1515
|
-
} else {
|
|
1516
|
-
t58 = $[151];
|
|
1517
|
-
}
|
|
1518
|
-
return t58;
|
|
1519
|
-
};
|
|
1520
|
-
function _temp(q) {
|
|
1521
|
-
return performanceLevel(q.avgDurationMs) === "critical";
|
|
1522
|
-
}
|
|
1523
|
-
function _temp2(q_0) {
|
|
1524
|
-
return performanceLevel(q_0.avgDurationMs) === "warning";
|
|
1525
|
-
}
|
|
1526
|
-
function _temp3(q_1) {
|
|
1527
|
-
return performanceLevel(q_1.avgDurationMs) === "good";
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
const GET_METRICS = adminRef(ADMIN_FUNCTIONS.getMetrics);
|
|
1531
|
-
const formatDuration = (ms) => {
|
|
1532
|
-
const totalSeconds = Math.floor(ms / 1e3);
|
|
1533
|
-
const hours = Math.floor(totalSeconds / 3600);
|
|
1534
|
-
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
1535
|
-
const seconds = totalSeconds % 60;
|
|
1536
|
-
if (hours > 0) {
|
|
1537
|
-
return `${hours.toString()}h ${minutes.toString()}m`;
|
|
1538
|
-
}
|
|
1539
|
-
if (minutes > 0) {
|
|
1540
|
-
return `${minutes.toString()}m ${seconds.toString()}s`;
|
|
1541
|
-
}
|
|
1542
|
-
return `${seconds.toString()}s`;
|
|
1543
|
-
};
|
|
1544
|
-
const resolveTab = (hasQueryStats, activeTab) => hasQueryStats ? activeTab : "overview";
|
|
1545
|
-
const hitRate = (hits, misses) => {
|
|
1546
|
-
const total = hits + misses;
|
|
1547
|
-
return total === 0 ? "—" : `${(hits / total * 100).toFixed(1)}%`;
|
|
1548
|
-
};
|
|
1549
|
-
const StatCard = (t0) => {
|
|
1550
|
-
const $ = c(16);
|
|
1551
|
-
const {
|
|
1552
|
-
chart,
|
|
1553
|
-
footer,
|
|
1554
|
-
label,
|
|
1555
|
-
testId,
|
|
1556
|
-
value
|
|
1557
|
-
} = t0;
|
|
1558
|
-
let t1;
|
|
1559
|
-
if ($[0] !== label) {
|
|
1560
|
-
t1 = /* @__PURE__ */ jsxDEV("span", {
|
|
1561
|
-
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
1562
|
-
children: label
|
|
1563
|
-
}, void 0, false);
|
|
1564
|
-
$[0] = label;
|
|
1565
|
-
$[1] = t1;
|
|
1566
|
-
} else {
|
|
1567
|
-
t1 = $[1];
|
|
1568
|
-
}
|
|
1569
|
-
let t2;
|
|
1570
|
-
if ($[2] !== testId || $[3] !== value) {
|
|
1571
|
-
t2 = /* @__PURE__ */ jsxDEV("span", {
|
|
1572
|
-
className: "truncate text-2xl font-semibold tabular-nums text-foreground",
|
|
1573
|
-
"data-testid": testId,
|
|
1574
|
-
children: value
|
|
1575
|
-
}, void 0, false);
|
|
1576
|
-
$[2] = testId;
|
|
1577
|
-
$[3] = value;
|
|
1578
|
-
$[4] = t2;
|
|
1579
|
-
} else {
|
|
1580
|
-
t2 = $[4];
|
|
1581
|
-
}
|
|
1582
|
-
let t3;
|
|
1583
|
-
if ($[5] !== chart || $[6] !== t2) {
|
|
1584
|
-
t3 = /* @__PURE__ */ jsxDEV("div", {
|
|
1585
|
-
className: "flex items-center justify-between gap-3",
|
|
1586
|
-
children: [t2, chart]
|
|
1587
|
-
}, void 0, true);
|
|
1588
|
-
$[5] = chart;
|
|
1589
|
-
$[6] = t2;
|
|
1590
|
-
$[7] = t3;
|
|
1591
|
-
} else {
|
|
1592
|
-
t3 = $[7];
|
|
1593
|
-
}
|
|
1594
|
-
let t4;
|
|
1595
|
-
if ($[8] !== t1 || $[9] !== t3) {
|
|
1596
|
-
t4 = /* @__PURE__ */ jsxDEV("div", {
|
|
1597
|
-
className: "flex flex-col gap-2.5 p-4",
|
|
1598
|
-
children: [t1, t3]
|
|
1599
|
-
}, void 0, true);
|
|
1600
|
-
$[8] = t1;
|
|
1601
|
-
$[9] = t3;
|
|
1602
|
-
$[10] = t4;
|
|
1603
|
-
} else {
|
|
1604
|
-
t4 = $[10];
|
|
1605
|
-
}
|
|
1606
|
-
let t5;
|
|
1607
|
-
if ($[11] !== footer) {
|
|
1608
|
-
t5 = footer != null && /* @__PURE__ */ jsxDEV("div", {
|
|
1609
|
-
className: "border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",
|
|
1610
|
-
children: footer
|
|
1611
|
-
}, void 0, false);
|
|
1612
|
-
$[11] = footer;
|
|
1613
|
-
$[12] = t5;
|
|
1614
|
-
} else {
|
|
1615
|
-
t5 = $[12];
|
|
1616
|
-
}
|
|
1617
|
-
let t6;
|
|
1618
|
-
if ($[13] !== t4 || $[14] !== t5) {
|
|
1619
|
-
t6 = /* @__PURE__ */ jsxDEV(Card, {
|
|
1620
|
-
className: "justify-between gap-0 py-0",
|
|
1621
|
-
children: [t4, t5]
|
|
1622
|
-
}, void 0, true);
|
|
1623
|
-
$[13] = t4;
|
|
1624
|
-
$[14] = t5;
|
|
1625
|
-
$[15] = t6;
|
|
1626
|
-
} else {
|
|
1627
|
-
t6 = $[15];
|
|
1628
|
-
}
|
|
1629
|
-
return t6;
|
|
1630
|
-
};
|
|
1631
|
-
const MetricsPanel = ({
|
|
1632
|
-
initialShardKey
|
|
1633
|
-
}) => {
|
|
1634
|
-
const client = useLunora();
|
|
1635
|
-
const t = useT();
|
|
1636
|
-
const navigate = useNavigate();
|
|
1637
|
-
const [shardKey, setShardKey] = useState(initialShardKey ?? "");
|
|
1638
|
-
const [activeTab, setActiveTab] = useState("overview");
|
|
1639
|
-
const [history, setHistory] = useState([]);
|
|
1640
|
-
const lastRequestsRef = useRef(null);
|
|
1641
|
-
const lastShardRef = useRef(null);
|
|
1642
|
-
const mountedRef = useRef(true);
|
|
1643
|
-
useEffect(() => {
|
|
1644
|
-
mountedRef.current = true;
|
|
1645
|
-
return () => {
|
|
1646
|
-
mountedRef.current = false;
|
|
1647
|
-
};
|
|
1648
|
-
}, []);
|
|
1649
|
-
const debouncedShard = useDebounced(shardKey.trim(), 400);
|
|
1650
|
-
const openTrace = (traceId) => {
|
|
1651
|
-
writePendingTraceFilter({
|
|
1652
|
-
shardKey: debouncedShard,
|
|
1653
|
-
traceId
|
|
1654
|
-
});
|
|
1655
|
-
fireAndForget(navigate({
|
|
1656
|
-
to: "/traces"
|
|
1657
|
-
}));
|
|
1658
|
-
};
|
|
1659
|
-
const {
|
|
1660
|
-
data,
|
|
1661
|
-
error,
|
|
1662
|
-
liveError
|
|
1663
|
-
} = useAdminQuery(ADMIN_FUNCTIONS.getMetrics, {}, {
|
|
1664
|
-
live: true,
|
|
1665
|
-
shardKey: debouncedShard
|
|
1666
|
-
});
|
|
1667
|
-
const metrics = data ?? null;
|
|
1668
|
-
useEffect(() => {
|
|
1669
|
-
if (data === void 0) {
|
|
1670
|
-
return;
|
|
1671
|
-
}
|
|
1672
|
-
recordShard(debouncedShard);
|
|
1673
|
-
const next = data;
|
|
1674
|
-
const previous = lastRequestsRef.current;
|
|
1675
|
-
const shardChanged = lastShardRef.current !== null && lastShardRef.current !== next.shard;
|
|
1676
|
-
lastShardRef.current = next.shard;
|
|
1677
|
-
lastRequestsRef.current = next.requests;
|
|
1678
|
-
if (shardChanged) {
|
|
1679
|
-
setHistory([]);
|
|
1680
|
-
return;
|
|
1681
|
-
}
|
|
1682
|
-
if (previous !== null && next.requests >= previous) {
|
|
1683
|
-
setHistory((prior) => [...prior, next.requests - previous].slice(-30));
|
|
1684
|
-
}
|
|
1685
|
-
}, [data, debouncedShard]);
|
|
1686
|
-
const [shardResults, setShardResults] = useState(null);
|
|
1687
|
-
const [aggregating, setAggregating] = useState(false);
|
|
1688
|
-
const aggregateAll = async () => {
|
|
1689
|
-
setAggregating(true);
|
|
1690
|
-
const shards = shardsToAggregate(shardKey, loadRecentShards());
|
|
1691
|
-
try {
|
|
1692
|
-
const results = await Promise.all(shards.map(async (shard) => {
|
|
1693
|
-
try {
|
|
1694
|
-
const snapshot = await client.query(GET_METRICS, {}, callOptions(shard));
|
|
1695
|
-
return {
|
|
1696
|
-
error: null,
|
|
1697
|
-
metrics: snapshot,
|
|
1698
|
-
shard: shard === "" ? snapshot.shard : shard
|
|
1699
|
-
};
|
|
1700
|
-
} catch (error_) {
|
|
1701
|
-
return {
|
|
1702
|
-
error: errorMessage(error_),
|
|
1703
|
-
metrics: null,
|
|
1704
|
-
shard: shard === "" ? "__root__" : shard
|
|
1705
|
-
};
|
|
1706
|
-
}
|
|
1707
|
-
}));
|
|
1708
|
-
if (mountedRef.current) {
|
|
1709
|
-
setShardResults(results);
|
|
1710
|
-
}
|
|
1711
|
-
} finally {
|
|
1712
|
-
if (mountedRef.current) {
|
|
1713
|
-
setAggregating(false);
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
};
|
|
1717
|
-
const aggregate = shardResults === null ? null : aggregateMetrics(shardResults);
|
|
1718
|
-
const errorRate = metrics === null || metrics.requests === 0 ? "—" : `${(metrics.errors / metrics.requests * 100).toFixed(1)}%`;
|
|
1719
|
-
const currentDelta = history.length > 0 ? history.at(-1) : 0;
|
|
1720
|
-
const latencyPercentiles = metrics ? computeLatencyPercentiles(metrics) : {
|
|
1721
|
-
p90: 0,
|
|
1722
|
-
p95: 0
|
|
1723
|
-
};
|
|
1724
|
-
const formatMs = (ms) => {
|
|
1725
|
-
if (ms <= 0) {
|
|
1726
|
-
return "—";
|
|
1727
|
-
}
|
|
1728
|
-
if (ms < 1) {
|
|
1729
|
-
return `${(ms * 1e3).toFixed(0)}μs`;
|
|
1730
|
-
}
|
|
1731
|
-
if (ms < 1e3) {
|
|
1732
|
-
return `${ms.toFixed(1)}ms`;
|
|
1733
|
-
}
|
|
1734
|
-
return `${(ms / 1e3).toFixed(2)}s`;
|
|
1735
|
-
};
|
|
1736
|
-
const queryStats = useMemo(() => {
|
|
1737
|
-
if (!metrics || !("queryStats" in metrics)) {
|
|
1738
|
-
return void 0;
|
|
1739
|
-
}
|
|
1740
|
-
const snapQs = metrics.queryStats;
|
|
1741
|
-
if (!snapQs || !Array.isArray(snapQs)) {
|
|
1742
|
-
return void 0;
|
|
1743
|
-
}
|
|
1744
|
-
return enrichQueryStats(snapQs);
|
|
1745
|
-
}, [metrics]);
|
|
1746
|
-
const effectiveTab = resolveTab(queryStats !== void 0, activeTab);
|
|
1747
|
-
const runAggregate = () => {
|
|
1748
|
-
fireAndForget(aggregateAll());
|
|
1749
|
-
};
|
|
1750
|
-
const clearAggregate = () => {
|
|
1751
|
-
setShardResults(null);
|
|
1752
|
-
};
|
|
1753
|
-
const switchToOverview = () => {
|
|
1754
|
-
setActiveTab("overview");
|
|
1755
|
-
};
|
|
1756
|
-
const switchToQueryInsights = () => {
|
|
1757
|
-
setActiveTab("query-insights");
|
|
1758
|
-
};
|
|
1759
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
1760
|
-
className: "flex flex-col gap-4",
|
|
1761
|
-
"data-testid": "lunora-metrics",
|
|
1762
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1763
|
-
className: "flex flex-wrap items-center gap-2",
|
|
1764
|
-
children: [/* @__PURE__ */ jsxDEV(ShardInput, {
|
|
1765
|
-
onChange: setShardKey,
|
|
1766
|
-
testId: "mt-shard-input",
|
|
1767
|
-
value: shardKey
|
|
1768
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(LiveError, {
|
|
1769
|
-
message: liveError,
|
|
1770
|
-
prefix: "mt"
|
|
1771
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
|
|
1772
|
-
"data-testid": "mt-aggregate",
|
|
1773
|
-
disabled: aggregating,
|
|
1774
|
-
onClick: runAggregate,
|
|
1775
|
-
size: "sm",
|
|
1776
|
-
type: "button",
|
|
1777
|
-
variant: "secondary",
|
|
1778
|
-
children: aggregating ? t("Aggregating…") : t("All shards")
|
|
1779
|
-
}, void 0, false), shardResults !== null && /* @__PURE__ */ jsxDEV(Button, {
|
|
1780
|
-
"data-testid": "mt-aggregate-clear",
|
|
1781
|
-
onClick: clearAggregate,
|
|
1782
|
-
size: "sm",
|
|
1783
|
-
type: "button",
|
|
1784
|
-
variant: "ghost",
|
|
1785
|
-
children: t("Hide")
|
|
1786
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("a", {
|
|
1787
|
-
className: "text-sm text-primary underline-offset-4 hover:underline",
|
|
1788
|
-
"data-testid": "mt-cf-link",
|
|
1789
|
-
href: CLOUDFLARE_DURABLE_OBJECTS_URL,
|
|
1790
|
-
rel: "noreferrer",
|
|
1791
|
-
target: "_blank",
|
|
1792
|
-
children: t("Open in Cloudflare")
|
|
1793
|
-
}, void 0, false)]
|
|
1794
|
-
}, void 0, true), error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
1795
|
-
className: "text-sm text-destructive",
|
|
1796
|
-
"data-testid": "mt-error",
|
|
1797
|
-
role: "alert",
|
|
1798
|
-
children: error
|
|
1799
|
-
}, void 0, false), queryStats !== void 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
1800
|
-
className: "flex gap-2 border-b",
|
|
1801
|
-
"data-testid": "mt-tabs",
|
|
1802
|
-
children: [/* @__PURE__ */ jsxDEV("button", {
|
|
1803
|
-
className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "overview" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1804
|
-
"data-testid": "mt-tab-overview",
|
|
1805
|
-
onClick: switchToOverview,
|
|
1806
|
-
type: "button",
|
|
1807
|
-
children: t("Overview")
|
|
1808
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("button", {
|
|
1809
|
-
className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "query-insights" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1810
|
-
"data-testid": "mt-tab-query-insights",
|
|
1811
|
-
onClick: switchToQueryInsights,
|
|
1812
|
-
type: "button",
|
|
1813
|
-
children: [t("Query insights"), queryStats.length > 0 && /* @__PURE__ */ jsxDEV("span", {
|
|
1814
|
-
className: "ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",
|
|
1815
|
-
children: queryStats.length
|
|
1816
|
-
}, void 0, false)]
|
|
1817
|
-
}, void 0, true)]
|
|
1818
|
-
}, void 0, true), effectiveTab === "query-insights" && queryStats !== void 0 && /* @__PURE__ */ jsxDEV(QueryInsights, {
|
|
1819
|
-
queryStats
|
|
1820
|
-
}, void 0, false), effectiveTab === "overview" && metrics !== null && /* @__PURE__ */ jsxDEV("dl", {
|
|
1821
|
-
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
1822
|
-
"data-testid": "mt-stats",
|
|
1823
|
-
children: [/* @__PURE__ */ jsxDEV(StatCard, {
|
|
1824
|
-
chart: history.length >= 2 ? /* @__PURE__ */ jsxDEV(Sparkline, {
|
|
1825
|
-
ariaLabel: t("Requests per interval over time"),
|
|
1826
|
-
className: "h-7 w-24 text-foreground",
|
|
1827
|
-
series: history,
|
|
1828
|
-
testId: "mt-sparkline"
|
|
1829
|
-
}, void 0, false) : void 0,
|
|
1830
|
-
footer: history.length >= 2 ? /* @__PURE__ */ jsxDEV(Fragment, {
|
|
1831
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
1832
|
-
className: "font-semibold text-foreground",
|
|
1833
|
-
children: `+${currentDelta.toLocaleString()}`
|
|
1834
|
-
}, void 0, false), " ", t("last interval")]
|
|
1835
|
-
}, void 0, true) : /* @__PURE__ */ jsxDEV("span", {
|
|
1836
|
-
"data-testid": "mt-sparkline-empty",
|
|
1837
|
-
children: t("collecting samples…")
|
|
1838
|
-
}, void 0, false),
|
|
1839
|
-
label: t("Requests"),
|
|
1840
|
-
testId: "mt-requests",
|
|
1841
|
-
value: metrics.requests
|
|
1842
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1843
|
-
footer: t("{rate} error rate", {
|
|
1844
|
-
rate: errorRate
|
|
1845
|
-
}),
|
|
1846
|
-
label: t("Errors"),
|
|
1847
|
-
testId: "mt-errors",
|
|
1848
|
-
value: /* @__PURE__ */ jsxDEV(Fragment, {
|
|
1849
|
-
children: [metrics.errors, " (", errorRate, ")"]
|
|
1850
|
-
}, void 0, true)
|
|
1851
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1852
|
-
footer: latencyPercentiles.p90 > 0 ? `P90 ${formatMs(latencyPercentiles.p90)}` : void 0,
|
|
1853
|
-
label: t("P95 latency"),
|
|
1854
|
-
testId: "mt-p95",
|
|
1855
|
-
value: latencyPercentiles.p95 > 0 ? formatMs(latencyPercentiles.p95) : "—"
|
|
1856
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1857
|
-
footer: metrics.cache === null ? void 0 : `${metrics.cache.entries.toLocaleString()} ${t("cache entries")}`,
|
|
1858
|
-
label: t("Database size"),
|
|
1859
|
-
testId: "mt-db-size",
|
|
1860
|
-
value: formatBytes(metrics.databaseSize)
|
|
1861
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1862
|
-
label: t("Shard"),
|
|
1863
|
-
testId: "mt-shard",
|
|
1864
|
-
value: metrics.shard
|
|
1865
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1866
|
-
label: t("Uptime"),
|
|
1867
|
-
testId: "mt-uptime",
|
|
1868
|
-
value: formatDuration(metrics.uptimeMs)
|
|
1869
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1870
|
-
label: t("Cache hit rate"),
|
|
1871
|
-
testId: "mt-cache",
|
|
1872
|
-
value: metrics.cache === null ? t("no cache configured") : t("{rate} ({count} entries)", {
|
|
1873
|
-
count: metrics.cache.entries,
|
|
1874
|
-
rate: hitRate(metrics.cache.hits, metrics.cache.misses)
|
|
1875
|
-
})
|
|
1876
|
-
}, void 0, false)]
|
|
1877
|
-
}, void 0, true), effectiveTab === "overview" && metrics === null && null, effectiveTab === "overview" && /* @__PURE__ */ jsxDEV(InstrumentsTable, {
|
|
1878
|
-
onOpenTrace: openTrace,
|
|
1879
|
-
shardKey: debouncedShard
|
|
1880
|
-
}, void 0, false), effectiveTab === "overview" && aggregate !== null && shardResults !== null && /* @__PURE__ */ jsxDEV("div", {
|
|
1881
|
-
className: "flex flex-col gap-4",
|
|
1882
|
-
"data-testid": "mt-aggregate-view",
|
|
1883
|
-
children: [/* @__PURE__ */ jsxDEV("dl", {
|
|
1884
|
-
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
1885
|
-
"data-testid": "mt-aggregate-stats",
|
|
1886
|
-
children: [/* @__PURE__ */ jsxDEV(StatCard, {
|
|
1887
|
-
label: t("Shards"),
|
|
1888
|
-
testId: "mt-agg-shards",
|
|
1889
|
-
value: aggregate.failed > 0 ? t("{reachable} reachable, {failed} unreachable", {
|
|
1890
|
-
failed: aggregate.failed,
|
|
1891
|
-
reachable: aggregate.reachable
|
|
1892
|
-
}) : t("{reachable} reachable", {
|
|
1893
|
-
reachable: aggregate.reachable
|
|
1894
|
-
})
|
|
1895
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1896
|
-
label: t("Total requests"),
|
|
1897
|
-
testId: "mt-agg-requests",
|
|
1898
|
-
value: aggregate.totalRequests
|
|
1899
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1900
|
-
label: t("Total errors"),
|
|
1901
|
-
testId: "mt-agg-errors",
|
|
1902
|
-
value: aggregate.totalErrors
|
|
1903
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1904
|
-
label: t("Total database size"),
|
|
1905
|
-
testId: "mt-agg-db-size",
|
|
1906
|
-
value: formatBytes(aggregate.totalDatabaseSize)
|
|
1907
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
|
|
1908
|
-
label: t("Combined cache hit rate"),
|
|
1909
|
-
testId: "mt-agg-cache",
|
|
1910
|
-
value: aggregate.hitRate === null ? t("no cache configured") : `${(aggregate.hitRate * 100).toFixed(1)}%`
|
|
1911
|
-
}, void 0, false)]
|
|
1912
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
|
|
1913
|
-
className: "overflow-hidden py-0",
|
|
1914
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
1915
|
-
className: "px-0",
|
|
1916
|
-
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
1917
|
-
"data-testid": "mt-agg-table",
|
|
1918
|
-
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
1919
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
1920
|
-
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
1921
|
-
children: t("shard")
|
|
1922
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
1923
|
-
children: t("requests")
|
|
1924
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
1925
|
-
children: t("errors")
|
|
1926
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
1927
|
-
children: t("db size")
|
|
1928
|
-
}, void 0, false)]
|
|
1929
|
-
}, void 0, true)
|
|
1930
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
1931
|
-
children: shardResults.map((result) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
1932
|
-
"data-testid": `mt-agg-row-${result.shard}`,
|
|
1933
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
1934
|
-
children: result.shard
|
|
1935
|
-
}, void 0, false), result.metrics === null ? /* @__PURE__ */ jsxDEV(TableCell, {
|
|
1936
|
-
className: "text-destructive",
|
|
1937
|
-
colSpan: 3,
|
|
1938
|
-
children: result.error ?? t("unreachable")
|
|
1939
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV(Fragment, {
|
|
1940
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
1941
|
-
className: "tabular-nums",
|
|
1942
|
-
children: result.metrics.requests
|
|
1943
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
1944
|
-
className: "tabular-nums",
|
|
1945
|
-
children: result.metrics.errors
|
|
1946
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
1947
|
-
className: "tabular-nums",
|
|
1948
|
-
children: formatBytes(result.metrics.databaseSize)
|
|
1949
|
-
}, void 0, false)]
|
|
1950
|
-
}, void 0, true)]
|
|
1951
|
-
}, result.shard, true))
|
|
1952
|
-
}, void 0, false)]
|
|
1953
|
-
}, void 0, true)
|
|
1954
|
-
}, void 0, false)
|
|
1955
|
-
}, void 0, false)]
|
|
1956
|
-
}, void 0, true)]
|
|
1957
|
-
}, void 0, true);
|
|
1958
|
-
};
|
|
1959
|
-
|
|
1960
|
-
export { MetricsPanel };
|
|
1
|
+
import{c as Fe}from"react/compiler-runtime";import{useLunora as lt}from"@lunora/react";import{useNavigate as st}from"@tanstack/react-router";import{useState as ue,useRef as Ke,useEffect as He,useMemo as nt}from"react";import{L as it}from"../packem_shared/live-status-CGW2JHf_.js";import{ShardInput as ot}from"../packem_shared/ShardInput-BVn2iCU0.js";import{u as Ve}from"../packem_shared/button-BkCrNcAs.js";import{c as me,u as he,n as Oe,f as Re,m as ct}from"../packem_shared/card-CIDGUN6K.js";import{p as re,d as Xe,m as Ae,u as Y,n as Ze,f as Ye}from"../packem_shared/table-DdJBrClo.js";import{K as We}from"../packem_shared/use-admin-query-Di3fLE8H.js";import dt from"../packem_shared/useDebounced-Ihdiid_k.js";import{useT as Ee}from"../packem_shared/DEFAULT_LOCALE-BZ4NojpD.js";import{ADMIN_FUNCTIONS as ze}from"../packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js";import{c as mt}from"../packem_shared/cf-links-gbDy51nR.js";import{k as Pe,f as Ge,c as ut,e as ht,a as gt}from"../packem_shared/internal-AtZ4bTal.js";import{r as ft,l as xt}from"../packem_shared/shard-history-DMEW5VBE.js";import{w as pt}from"../packem_shared/trace-handoff-Dw7mwjxu.js";import{f as bt}from"../packem_shared/log-fields-CoL3hsIQ.js";import{g as et}from"../packem_shared/badge-BbuuAio7.js";import{S as tt}from"../packem_shared/sparkline-DtcZoU48.js";import{jsx as t,jsxs as n,Fragment as Je}from"react/jsx-runtime";import{aggregateMetrics as vt,computeLatencyPercentiles as Nt,enrichQueryStats as yt,shardsToAggregate as $t}from"../packem_shared/aggregateMetrics-BNfajLa2.js";import{N as wt,y as St,k as De,_ as qt,w as kt}from"../packem_shared/select-Bul-DeII.js";const _t=(s,e)=>s<e?-1:s>e?1:0,Be=s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key — pass it as a string, or use stableWireKey");if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s))return`[${s.map(x=>Be(x)).join(",")}]`;const e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){const x=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${x} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}const l=s,r=Object.keys(l).toSorted(_t),a=[];for(const x of r){const p=l[x];p!==void 0&&a.push(`${JSON.stringify(x)}:${Be(p)}`)}return`{${a.join(",")}}`},rt=(s,e,l)=>`${s}:${e}:${Be(l??{})}`,at=(s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,Mt=(s,e)=>at(s,e),It=s=>at(s.kind,s),Qe=s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),Ft=s=>Array.isArray(s?.series)?s.series:[],Ct=s=>{const e=new Map;if(!Array.isArray(s?.series))return e;for(const l of s.series)e.set(rt(l.kind,l.name,l.attributes),l.points);return e},Tt={counter:"secondary",gauge:"default",histogram:"outline"},Ot=s=>{const e=Fe(18),{name:l,onOpenTrace:r,traceId:a}=s,x=Ee();if(a===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t("span",{className:"text-muted-foreground",children:"—"}),e[0]=c):c=e[0],c}let p;e[1]!==a?(p=a.slice(0,8),e[1]=a,e[2]=p):p=e[2];const g=p;if(r===void 0){const c=`mt-instrument-trace-${l}`;let N;return e[3]!==g||e[4]!==c||e[5]!==a?(N=t("span",{className:"text-muted-foreground","data-testid":c,title:a,children:g}),e[3]=g,e[4]=c,e[5]=a,e[6]=N):N=e[6],N}const v=`mt-instrument-trace-${l}`;let u;e[7]!==r||e[8]!==a?(u=()=>{r(a)},e[7]=r,e[8]=a,e[9]=u):u=e[9];let b;e[10]!==x||e[11]!==a?(b=x("Open the exemplar trace {trace}",{trace:a}),e[10]=x,e[11]=a,e[12]=b):b=e[12];let h;return e[13]!==g||e[14]!==v||e[15]!==u||e[16]!==b?(h=t("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":v,onClick:u,title:b,type:"button",children:g}),e[13]=g,e[14]=v,e[15]=u,e[16]=b,e[17]=h):h=e[17],h},Rt=s=>{const e=Fe(92),{onOpenTrace:l,shardKey:r}=s,a=Ee();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let p;e[1]!==r?(p={live:!0,shardKey:r},e[1]=r,e[2]=p):p=e[2];const{data:g,error:v}=We(ze.getMetricSeries,x,p);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let b;e[4]!==r?(b={live:!0,shardKey:r},e[4]=r,e[5]=b):b=e[5];const{data:h}=We(ze.getMetricHistory,u,b);let c,N,ee,C,z,E,o,M,ae,T,q,D,f;if(e[6]!==g||e[7]!==v||e[8]!==h||e[9]!==l||e[10]!==a){M=Symbol.for("react.early_return_sentinel");e:{const I=Ft(g);if(v!==null||I.length===0){M=null;break e}const le=Ct(h);let j;e[24]!==a?(j=m=>a(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),e[24]=a,e[25]=j):j=e[25];const se=j;z="flex flex-col gap-2",E="mt-instruments";let A;e[26]!==a?(A=a("Instruments"),e[26]=a,e[27]=A):A=e[27],e[28]!==A?(o=t("h3",{className:"text-sm font-semibold text-foreground",children:A}),e[28]=A,e[29]=o):o=e[29],C=me,f="overflow-hidden py-0",ee=he,D="px-0",N=Ze,T="mt-instruments-table";let i;e[30]!==a?(i=a("name"),e[30]=a,e[31]=i):i=e[31];let w;e[32]!==i?(w=t(re,{children:i}),e[32]=i,e[33]=w):w=e[33];let y;e[34]!==a?(y=a("kind"),e[34]=a,e[35]=y):y=e[35];let $;e[36]!==y?($=t(re,{children:y}),e[36]=y,e[37]=$):$=e[37];let K;e[38]!==a?(K=a("value"),e[38]=a,e[39]=K):K=e[39];let P;e[40]!==K?(P=t(re,{className:"text-right",children:K}),e[40]=K,e[41]=P):P=e[41];let J;e[42]!==a?(J=a("count"),e[42]=a,e[43]=J):J=e[43];let Q;e[44]!==J?(Q=t(re,{className:"text-right",children:J}),e[44]=J,e[45]=Q):Q=e[45];let U;e[46]!==a?(U=a("range"),e[46]=a,e[47]=U):U=e[47];let W;e[48]!==U?(W=t(re,{className:"text-right",children:U}),e[48]=U,e[49]=W):W=e[49];let B;e[50]!==a?(B=a("trend"),e[50]=a,e[51]=B):B=e[51];let H;e[52]!==B?(H=t(re,{children:B}),e[52]=B,e[53]=H):H=e[53];let V;e[54]!==a?(V=a("trace"),e[54]=a,e[55]=V):V=e[55];let G;e[56]!==V?(G=t(re,{children:V}),e[56]=V,e[57]=G):G=e[57];let X;e[58]!==a?(X=a("dimensions"),e[58]=a,e[59]=X):X=e[59];let Z;e[60]!==X?(Z=t(re,{children:X}),e[60]=X,e[61]=Z):Z=e[61],e[62]!==w||e[63]!==$||e[64]!==P||e[65]!==Q||e[66]!==W||e[67]!==H||e[68]!==G||e[69]!==Z?(q=t(Xe,{children:n(Ae,{children:[w,$,P,Q,W,H,G,Z]})}),e[62]=w,e[63]=$,e[64]=P,e[65]=Q,e[66]=W,e[67]=H,e[68]=G,e[69]=Z,e[70]=q):q=e[70],c=Ye,ae=I.map(m=>{const ne=bt(m.attributes),ie=rt(m.kind,m.name,m.attributes),oe=(le.get(ie)??[]).map(ce=>Mt(m.kind,ce));return n(Ae,{"data-testid":`mt-instrument-${m.name}`,children:[t(Y,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),t(Y,{children:t(et,{variant:Tt[m.kind],children:se(m.kind)})}),t(Y,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:Qe(It(m))}),t(Y,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),t(Y,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"—":`${Qe(m.min)}–${Qe(m.max)}`}),t(Y,{children:oe.length>=2?t(tt,{ariaLabel:a("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:oe,testId:`mt-instrument-trend-${m.name}`}):t("span",{className:"text-xs text-muted-foreground",children:"—"})}),t(Y,{className:"font-mono text-xs",children:t(Ot,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),t(Y,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:ne,children:ne===""?"—":ne})]},ie)})}e[6]=g,e[7]=v,e[8]=h,e[9]=l,e[10]=a,e[11]=c,e[12]=N,e[13]=ee,e[14]=C,e[15]=z,e[16]=E,e[17]=o,e[18]=M,e[19]=ae,e[20]=T,e[21]=q,e[22]=D,e[23]=f}else c=e[11],N=e[12],ee=e[13],C=e[14],z=e[15],E=e[16],o=e[17],M=e[18],ae=e[19],T=e[20],q=e[21],D=e[22],f=e[23];if(M!==Symbol.for("react.early_return_sentinel"))return M;let O;e[71]!==c||e[72]!==ae?(O=t(c,{children:ae}),e[71]=c,e[72]=ae,e[73]=O):O=e[73];let L;e[74]!==N||e[75]!==O||e[76]!==T||e[77]!==q?(L=n(N,{"data-testid":T,children:[q,O]}),e[74]=N,e[75]=O,e[76]=T,e[77]=q,e[78]=L):L=e[78];let k;e[79]!==ee||e[80]!==L||e[81]!==D?(k=t(ee,{className:D,children:L}),e[79]=ee,e[80]=L,e[81]=D,e[82]=k):k=e[82];let R;e[83]!==C||e[84]!==k||e[85]!==f?(R=t(C,{className:f,children:k}),e[83]=C,e[84]=k,e[85]=f,e[86]=R):R=e[86];let _;return e[87]!==z||e[88]!==E||e[89]!==o||e[90]!==R?(_=n("section",{className:z,"data-testid":E,children:[o,R]}),e[87]=z,e[88]=E,e[89]=o,e[90]=R,e[91]=_):_=e[91],_},je=s=>s>=100?"critical":s>=50?"warning":"good",Ue=s=>s<1?`${(s*1e3).toFixed(0)}μs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,Le=s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),Dt=s=>{const e=Fe(3),{level:l}=s;if(l==="critical"){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t(et,{variant:"destructive",children:"Slow"}),e[0]=a):a=e[0],a}if(l==="warning"){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=a):a=e[1],a}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=r):r=e[2],r},Lt=s=>{const e=Fe(152),{queryStats:l}=s,r=Ee(),[a,x]=ue("totalTime");let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=new Set,e[0]=p):p=e[0];const[g,v]=ue(p);let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=d=>{d!==null&&x(d)},e[1]=u):u=e[1];const b=u;let h;if(e[2]!==l||e[3]!==a){h=[...l];let d;e[5]!==a?(d=(F,S)=>{switch(a){case"avgTime":return S.avgDurationMs-F.avgDurationMs;case"execCount":return S.execCount-F.execCount;case"rowsRead":return S.rowsRead-F.rowsRead;default:return S.totalDurationMs-F.totalDurationMs}},e[5]=a,e[6]=d):d=e[6],h.sort(d),e[2]=l,e[3]=a,e[4]=h}else h=e[4];const c=h;let N;e[7]!==l?(N=l.filter(At),e[7]=l,e[8]=N):N=e[8];const ee=N.length;let C;e[9]!==l?(C=l.filter(zt),e[9]=l,e[10]=C):C=e[10];const z=C.length;let E;e[11]!==l?(E=l.filter(Et),e[11]=l,e[12]=E):E=e[12];const o=E.length;let M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=d=>{v(F=>{const S=new Set(F);return S.has(d)?S.delete(d):S.add(d),S})},e[13]=M):M=e[13];const ae=M;if(l.length===0){let d;e[14]!==r?(d=r("No query insights yet"),e[14]=r,e[15]=d):d=e[15];let F;e[16]!==d?(F=t("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:d}),e[16]=d,e[17]=F):F=e[17];let S;e[18]!==r?(S=r("Query insights appear once statements are executed against this shard."),e[18]=r,e[19]=S):S=e[19];let de;e[20]!==S?(de=t("p",{className:"mt-1 text-sm",children:S}),e[20]=S,e[21]=de):de=e[21];let Te;return e[22]!==de||e[23]!==F?(Te=t(me,{children:t(he,{className:"py-12",children:n("div",{className:"text-center text-muted-foreground",children:[F,de]})})}),e[22]=de,e[23]=F,e[24]=Te):Te=e[24],Te}let T;e[25]!==r?(T=r("Critical queries"),e[25]=r,e[26]=T):T=e[26];let q;e[27]!==T?(q=t(Oe,{className:"pb-2",children:t(Re,{className:"text-sm font-medium",children:T})}),e[27]=T,e[28]=q):q=e[28];let D;e[29]!==ee?(D=t("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:ee}),e[29]=ee,e[30]=D):D=e[30];let f;e[31]!==r?(f=r(">100ms avg execution"),e[31]=r,e[32]=f):f=e[32];let O;e[33]!==f?(O=t("p",{className:"text-xs text-muted-foreground",children:f}),e[33]=f,e[34]=O):O=e[34];let L;e[35]!==O||e[36]!==D?(L=n(he,{children:[D,O]}),e[35]=O,e[36]=D,e[37]=L):L=e[37];let k;e[38]!==L||e[39]!==q?(k=n(me,{children:[q,L]}),e[38]=L,e[39]=q,e[40]=k):k=e[40];let R;e[41]!==r?(R=r("Moderate queries"),e[41]=r,e[42]=R):R=e[42];let _;e[43]!==R?(_=t(Oe,{className:"pb-2",children:t(Re,{className:"text-sm font-medium",children:R})}),e[43]=R,e[44]=_):_=e[44];let I;e[45]!==z?(I=t("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:z}),e[45]=z,e[46]=I):I=e[46];let le;e[47]!==r?(le=r("50–100ms avg execution"),e[47]=r,e[48]=le):le=e[48];let j;e[49]!==le?(j=t("p",{className:"text-xs text-muted-foreground",children:le}),e[49]=le,e[50]=j):j=e[50];let se;e[51]!==I||e[52]!==j?(se=n(he,{children:[I,j]}),e[51]=I,e[52]=j,e[53]=se):se=e[53];let A;e[54]!==_||e[55]!==se?(A=n(me,{children:[_,se]}),e[54]=_,e[55]=se,e[56]=A):A=e[56];let i;e[57]!==r?(i=r("Fast queries"),e[57]=r,e[58]=i):i=e[58];let w;e[59]!==i?(w=t(Oe,{className:"pb-2",children:t(Re,{className:"text-sm font-medium",children:i})}),e[59]=i,e[60]=w):w=e[60];let y;e[61]!==o?(y=t("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:o}),e[61]=o,e[62]=y):y=e[62];let $;e[63]!==r?($=r("<50ms avg execution"),e[63]=r,e[64]=$):$=e[64];let K;e[65]!==$?(K=t("p",{className:"text-xs text-muted-foreground",children:$}),e[65]=$,e[66]=K):K=e[66];let P;e[67]!==y||e[68]!==K?(P=n(he,{children:[y,K]}),e[67]=y,e[68]=K,e[69]=P):P=e[69];let J;e[70]!==w||e[71]!==P?(J=n(me,{children:[w,P]}),e[70]=w,e[71]=P,e[72]=J):J=e[72];let Q;e[73]!==k||e[74]!==A||e[75]!==J?(Q=n("div",{className:"grid gap-4 md:grid-cols-3",children:[k,A,J]}),e[73]=k,e[74]=A,e[75]=J,e[76]=Q):Q=e[76];let U;e[77]!==r?(U=r("Query leaderboard"),e[77]=r,e[78]=U):U=e[78];let W;e[79]!==U?(W=t("h3",{className:"text-lg font-semibold",children:U}),e[79]=U,e[80]=W):W=e[80];let B;e[81]!==a||e[82]!==r?(B=r("Slow queries sorted by {sortField}",{sortField:r(a)}),e[81]=a,e[82]=r,e[83]=B):B=e[83];let H;e[84]!==B?(H=t("p",{className:"text-sm text-muted-foreground",children:B}),e[84]=B,e[85]=H):H=e[85];let V;e[86]!==W||e[87]!==H?(V=n("div",{children:[W,H]}),e[86]=W,e[87]=H,e[88]=V):V=e[88];let G;e[89]!==r?(G=r("Sort by"),e[89]=r,e[90]=G):G=e[90];let X;e[91]!==G?(X=t("span",{className:"text-sm text-muted-foreground",children:G}),e[91]=G,e[92]=X):X=e[92];let Z;e[93]!==r?(Z=r("Sort queries by"),e[93]=r,e[94]=Z):Z=e[94];let m;e[95]===Symbol.for("react.memo_cache_sentinel")?(m=t(wt,{}),e[95]=m):m=e[95];let ne;e[96]!==Z?(ne=t(St,{"aria-label":Z,className:"w-[140px]","data-testid":"qi-sort",children:m}),e[96]=Z,e[97]=ne):ne=e[97];let ie;e[98]!==r?(ie=r("Total time"),e[98]=r,e[99]=ie):ie=e[99];let oe;e[100]!==ie?(oe=t(De,{value:"totalTime",children:ie}),e[100]=ie,e[101]=oe):oe=e[101];let ce;e[102]!==r?(ce=r("Avg time"),e[102]=r,e[103]=ce):ce=e[103];let ge;e[104]!==ce?(ge=t(De,{value:"avgTime",children:ce}),e[104]=ce,e[105]=ge):ge=e[105];let fe;e[106]!==r?(fe=r("Execution count"),e[106]=r,e[107]=fe):fe=e[107];let xe;e[108]!==fe?(xe=t(De,{value:"execCount",children:fe}),e[108]=fe,e[109]=xe):xe=e[109];let pe;e[110]!==r?(pe=r("Rows read"),e[110]=r,e[111]=pe):pe=e[111];let be;e[112]!==pe?(be=t(De,{value:"rowsRead",children:pe}),e[112]=pe,e[113]=be):be=e[113];let ve;e[114]!==oe||e[115]!==ge||e[116]!==xe||e[117]!==be?(ve=n(qt,{children:[oe,ge,xe,be]}),e[114]=oe,e[115]=ge,e[116]=xe,e[117]=be,e[118]=ve):ve=e[118];let Ne;e[119]!==a||e[120]!==ne||e[121]!==ve?(Ne=n(kt,{onValueChange:b,value:a,children:[ne,ve]}),e[119]=a,e[120]=ne,e[121]=ve,e[122]=Ne):Ne=e[122];let ye;e[123]!==X||e[124]!==Ne?(ye=n("div",{className:"flex items-center gap-2",children:[X,Ne]}),e[123]=X,e[124]=Ne,e[125]=ye):ye=e[125];let $e;e[126]!==V||e[127]!==ye?($e=n("div",{className:"flex items-center justify-between",children:[V,ye]}),e[126]=V,e[127]=ye,e[128]=$e):$e=e[128];let we;e[129]!==r?(we=r("Statements"),e[129]=r,e[130]=we):we=e[130];let Se;e[131]!==we?(Se=t(Re,{children:we}),e[131]=we,e[132]=Se):Se=e[132];let qe;e[133]!==c.length||e[134]!==r?(qe=r("{count} tracked statements",{count:c.length}),e[133]=c.length,e[134]=r,e[135]=qe):qe=e[135];let ke;e[136]!==qe?(ke=t(ct,{children:qe}),e[136]=qe,e[137]=ke):ke=e[137];let _e;e[138]!==Se||e[139]!==ke?(_e=n(Oe,{children:[Se,ke]}),e[138]=Se,e[139]=ke,e[140]=_e):_e=e[140];let Me;e[141]!==g||e[142]!==c||e[143]!==r?(Me=t(he,{children:t("div",{className:"space-y-2",children:c.map(d=>{const F=d.normalizedSql,S=g.has(F),de=je(d.avgDurationMs);return n("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[n("button",{"aria-expanded":S,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:()=>{ae(F)},type:"button",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t(Dt,{level:de}),t("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:d.normalizedSql})]}),n("div",{className:"flex shrink-0 items-center gap-4",children:[n("div",{className:"text-right",children:[t("div",{className:"text-sm font-medium",children:Ue(d.totalDurationMs)}),t("div",{className:"text-xs text-muted-foreground",children:r("total")})]}),n("div",{className:"text-right",children:[t("div",{className:"text-sm font-medium",children:Ue(d.avgDurationMs)}),t("div",{className:"text-xs text-muted-foreground",children:r("avg")})]}),n("div",{className:"text-right",children:[t("div",{className:"text-sm font-medium",children:Le(d.execCount)}),t("div",{className:"text-xs text-muted-foreground",children:r("calls")})]})]})]}),S&&n("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[n("div",{children:[t("p",{className:"mb-2 text-sm font-medium",children:r("Full statement")}),t("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:d.normalizedSql})]}),n("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[n("div",{children:[t("span",{className:"text-muted-foreground",children:r("Exec count")}),t("span",{className:"block font-medium tabular-nums",children:Le(d.execCount)})]}),n("div",{children:[t("span",{className:"text-muted-foreground",children:r("Total time")}),t("span",{className:"block font-medium tabular-nums",children:Ue(d.totalDurationMs)})]}),n("div",{children:[t("span",{className:"text-muted-foreground",children:r("Rows read")}),t("span",{className:"block font-medium tabular-nums",children:Le(d.rowsRead)})]}),n("div",{children:[t("span",{className:"text-muted-foreground",children:r("Rows written")}),t("span",{className:"block font-medium tabular-nums",children:Le(d.rowsWritten)})]})]})]})]},F)})})}),e[141]=g,e[142]=c,e[143]=r,e[144]=Me):Me=e[144];let Ie;e[145]!==_e||e[146]!==Me?(Ie=n(me,{children:[_e,Me]}),e[145]=_e,e[146]=Me,e[147]=Ie):Ie=e[147];let Ce;return e[148]!==Q||e[149]!==$e||e[150]!==Ie?(Ce=n("div",{className:"space-y-4","data-testid":"qi-root",children:[Q,$e,Ie]}),e[148]=Q,e[149]=$e,e[150]=Ie,e[151]=Ce):Ce=e[151],Ce};function At(s){return je(s.avgDurationMs)==="critical"}function zt(s){return je(s.avgDurationMs)==="warning"}function Et(s){return je(s.avgDurationMs)==="good"}const jt=gt(ze.getMetrics),Kt=s=>{const e=Math.floor(s/1e3),l=Math.floor(e/3600),r=Math.floor(e%3600/60),a=e%60;return l>0?`${l.toString()}h ${r.toString()}m`:r>0?`${r.toString()}m ${a.toString()}s`:`${a.toString()}s`},Pt=(s,e)=>s?e:"overview",Jt=(s,e)=>{const l=s+e;return l===0?"—":`${(s/l*100).toFixed(1)}%`},te=s=>{const e=Fe(16),{chart:l,footer:r,label:a,testId:x,value:p}=s;let g;e[0]!==a?(g=t("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a}),e[0]=a,e[1]=g):g=e[1];let v;e[2]!==x||e[3]!==p?(v=t("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":x,children:p}),e[2]=x,e[3]=p,e[4]=v):v=e[4];let u;e[5]!==l||e[6]!==v?(u=n("div",{className:"flex items-center justify-between gap-3",children:[v,l]}),e[5]=l,e[6]=v,e[7]=u):u=e[7];let b;e[8]!==g||e[9]!==u?(b=n("div",{className:"flex flex-col gap-2.5 p-4",children:[g,u]}),e[8]=g,e[9]=u,e[10]=b):b=e[10];let h;e[11]!==r?(h=r!=null&&t("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:r}),e[11]=r,e[12]=h):h=e[12];let c;return e[13]!==b||e[14]!==h?(c=n(me,{className:"justify-between gap-0 py-0",children:[b,h]}),e[13]=b,e[14]=h,e[15]=c):c=e[15],c},hr=({initialShardKey:s})=>{const e=lt(),l=Ee(),r=st(),[a,x]=ue(s??""),[p,g]=ue("overview"),[v,u]=ue([]),b=Ke(null),h=Ke(null),c=Ke(!0);He(()=>(c.current=!0,()=>{c.current=!1}),[]);const N=dt(a.trim(),400),ee=i=>{pt({shardKey:N,traceId:i}),Ge(r({to:"/traces"}))},{data:C,error:z,liveError:E}=We(ze.getMetrics,{},{live:!0,shardKey:N}),o=C??null;He(()=>{if(C===void 0)return;ft(N);const i=C,w=b.current,y=h.current!==null&&h.current!==i.shard;if(h.current=i.shard,b.current=i.requests,y){u([]);return}w!==null&&i.requests>=w&&u($=>[...$,i.requests-w].slice(-30))},[C,N]);const[M,ae]=ue(null),[T,q]=ue(!1),D=async()=>{q(!0);const i=$t(a,xt());try{const w=await Promise.all(i.map(async y=>{try{const $=await e.query(jt,{},ut(y));return{error:null,metrics:$,shard:y===""?$.shard:y}}catch($){return{error:ht($),metrics:null,shard:y===""?"__root__":y}}}));c.current&&ae(w)}finally{c.current&&q(!1)}},f=M===null?null:vt(M),O=o===null||o.requests===0?"—":`${(o.errors/o.requests*100).toFixed(1)}%`,L=v.length>0?v.at(-1):0,k=o?Nt(o):{p90:0,p95:0},R=i=>i<=0?"—":i<1?`${(i*1e3).toFixed(0)}μs`:i<1e3?`${i.toFixed(1)}ms`:`${(i/1e3).toFixed(2)}s`,_=nt(()=>{if(!o||!("queryStats"in o))return;const i=o.queryStats;if(!(!i||!Array.isArray(i)))return yt(i)},[o]),I=Pt(_!==void 0,p),le=()=>{Ge(D())},j=()=>{ae(null)},se=()=>{g("overview")},A=()=>{g("query-insights")};return n("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[n("div",{className:"flex flex-wrap items-center gap-2",children:[t(ot,{onChange:x,testId:"mt-shard-input",value:a}),t(it,{message:E,prefix:"mt"}),t(Ve,{"data-testid":"mt-aggregate",disabled:T,onClick:le,size:"sm",type:"button",variant:"secondary",children:l(T?"Aggregating…":"All shards")}),M!==null&&t(Ve,{"data-testid":"mt-aggregate-clear",onClick:j,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),t("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:mt,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),z!==null&&t("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:z}),_!==void 0&&n("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[t("button",{className:`pb-2 text-sm font-medium transition-colors ${I==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:se,type:"button",children:l("Overview")}),n("button",{className:`pb-2 text-sm font-medium transition-colors ${I==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:A,type:"button",children:[l("Query insights"),_.length>0&&t("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:_.length})]})]}),I==="query-insights"&&_!==void 0&&t(Lt,{queryStats:_}),I==="overview"&&o!==null&&n("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[t(te,{chart:v.length>=2?t(tt,{ariaLabel:l("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:v,testId:"mt-sparkline"}):void 0,footer:v.length>=2?n(Je,{children:[t("span",{className:"font-semibold text-foreground",children:`+${L.toLocaleString()}`})," ",l("last interval")]}):t("span",{"data-testid":"mt-sparkline-empty",children:l("collecting samples…")}),label:l("Requests"),testId:"mt-requests",value:o.requests}),t(te,{footer:l("{rate} error rate",{rate:O}),label:l("Errors"),testId:"mt-errors",value:n(Je,{children:[o.errors," (",O,")"]})}),t(te,{footer:k.p90>0?`P90 ${R(k.p90)}`:void 0,label:l("P95 latency"),testId:"mt-p95",value:k.p95>0?R(k.p95):"—"}),t(te,{footer:o.cache===null?void 0:`${o.cache.entries.toLocaleString()} ${l("cache entries")}`,label:l("Database size"),testId:"mt-db-size",value:Pe(o.databaseSize)}),t(te,{label:l("Shard"),testId:"mt-shard",value:o.shard}),t(te,{label:l("Uptime"),testId:"mt-uptime",value:Kt(o.uptimeMs)}),t(te,{label:l("Cache hit rate"),testId:"mt-cache",value:o.cache===null?l("no cache configured"):l("{rate} ({count} entries)",{count:o.cache.entries,rate:Jt(o.cache.hits,o.cache.misses)})})]}),I==="overview"&&o===null&&null,I==="overview"&&t(Rt,{onOpenTrace:ee,shardKey:N}),I==="overview"&&f!==null&&M!==null&&n("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[n("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[t(te,{label:l("Shards"),testId:"mt-agg-shards",value:f.failed>0?l("{reachable} reachable, {failed} unreachable",{failed:f.failed,reachable:f.reachable}):l("{reachable} reachable",{reachable:f.reachable})}),t(te,{label:l("Total requests"),testId:"mt-agg-requests",value:f.totalRequests}),t(te,{label:l("Total errors"),testId:"mt-agg-errors",value:f.totalErrors}),t(te,{label:l("Total database size"),testId:"mt-agg-db-size",value:Pe(f.totalDatabaseSize)}),t(te,{label:l("Combined cache hit rate"),testId:"mt-agg-cache",value:f.hitRate===null?l("no cache configured"):`${(f.hitRate*100).toFixed(1)}%`})]}),t(me,{className:"overflow-hidden py-0",children:t(he,{className:"px-0",children:n(Ze,{"data-testid":"mt-agg-table",children:[t(Xe,{children:n(Ae,{children:[t(re,{children:l("shard")}),t(re,{children:l("requests")}),t(re,{children:l("errors")}),t(re,{children:l("db size")})]})}),t(Ye,{children:M.map(i=>n(Ae,{"data-testid":`mt-agg-row-${i.shard}`,children:[t(Y,{children:i.shard}),i.metrics===null?t(Y,{className:"text-destructive",colSpan:3,children:i.error??l("unreachable")}):n(Je,{children:[t(Y,{className:"tabular-nums",children:i.metrics.requests}),t(Y,{className:"tabular-nums",children:i.metrics.errors}),t(Y,{className:"tabular-nums",children:Pe(i.metrics.databaseSize)})]})]},i.shard))})]})})})]})]})};export{hr as MetricsPanel};
|