adonisjs-server-stats 1.5.4 → 1.6.2
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/README.md +351 -171
- package/dist/configure.d.ts.map +1 -1
- package/dist/core/api-client.d.ts +73 -0
- package/dist/core/api-client.d.ts.map +1 -0
- package/dist/core/config-utils.d.ts +109 -0
- package/dist/core/config-utils.d.ts.map +1 -0
- package/dist/core/constants.d.ts +11 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/dashboard-api.d.ts +65 -0
- package/dist/core/dashboard-api.d.ts.map +1 -0
- package/dist/core/dashboard-data-controller.d.ts +157 -0
- package/dist/core/dashboard-data-controller.d.ts.map +1 -0
- package/dist/core/debug-data-controller.d.ts +89 -0
- package/dist/core/debug-data-controller.d.ts.map +1 -0
- package/dist/core/feature-detect.d.ts +67 -0
- package/dist/core/feature-detect.d.ts.map +1 -0
- package/dist/core/formatters.d.ts +189 -0
- package/dist/core/formatters.d.ts.map +1 -0
- package/dist/core/history-buffer.d.ts +23 -0
- package/dist/core/history-buffer.d.ts.map +1 -0
- package/dist/core/icons.d.ts +36 -0
- package/dist/core/icons.d.ts.map +1 -0
- package/dist/core/index.d.ts +39 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +1961 -0
- package/dist/core/internals-utils.d.ts +71 -0
- package/dist/core/internals-utils.d.ts.map +1 -0
- package/dist/core/job-utils.d.ts +45 -0
- package/dist/core/job-utils.d.ts.map +1 -0
- package/dist/core/log-utils.d.ts +34 -0
- package/dist/core/log-utils.d.ts.map +1 -0
- package/dist/core/metrics.d.ts +41 -0
- package/dist/core/metrics.d.ts.map +1 -0
- package/dist/core/pagination.d.ts +128 -0
- package/dist/core/pagination.d.ts.map +1 -0
- package/dist/core/query-utils.d.ts +35 -0
- package/dist/core/query-utils.d.ts.map +1 -0
- package/dist/core/resizable-columns.d.ts +18 -0
- package/dist/core/resizable-columns.d.ts.map +1 -0
- package/dist/core/routes.d.ts +12 -0
- package/dist/core/routes.d.ts.map +1 -0
- package/dist/core/server-stats-controller.d.ts +106 -0
- package/dist/core/server-stats-controller.d.ts.map +1 -0
- package/dist/core/sparkline.d.ts +80 -0
- package/dist/core/sparkline.d.ts.map +1 -0
- package/dist/core/theme.d.ts +42 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/trace-utils.d.ts +62 -0
- package/dist/core/trace-utils.d.ts.map +1 -0
- package/dist/core/transmit-adapter.d.ts +59 -0
- package/dist/core/transmit-adapter.d.ts.map +1 -0
- package/dist/core/types.d.ts +619 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/react/CacheSection-DGxMDlWK.js +146 -0
- package/dist/react/CacheTab-CnVW5PLs.js +123 -0
- package/dist/react/ConfigContent-CnsEI4j3.js +397 -0
- package/dist/react/ConfigSection-DPcrfqXY.js +11 -0
- package/dist/react/ConfigTab-BSWq_o2p.js +15 -0
- package/dist/react/CustomPaneTab-xjkYwTvH.js +104 -0
- package/dist/react/DataTable-YyShr5B-.js +55 -0
- package/dist/react/EmailsSection-CSyTg1aX.js +262 -0
- package/dist/react/EmailsTab-Dh2YSa_f.js +131 -0
- package/dist/react/EventsSection-C1pbJDfW.js +86 -0
- package/dist/react/EventsTab-eCh02cdd.js +63 -0
- package/dist/react/FilterBar-DQRXpWrb.js +50 -0
- package/dist/react/InternalsContent-DBzsI0CG.js +346 -0
- package/dist/react/InternalsSection-t7ihcWO-.js +32 -0
- package/dist/react/InternalsTab-Oij0A2fN.js +30 -0
- package/dist/react/JobsSection-CLAin5vU.js +187 -0
- package/dist/react/JobsTab-Dl5nrj2z.js +141 -0
- package/dist/react/LogsSection-C1p81fXO.js +212 -0
- package/dist/react/LogsTab-D-kR7PjX.js +88 -0
- package/dist/react/OverviewSection-nm3xdACz.js +539 -0
- package/dist/react/Pagination-BkmzUDY8.js +64 -0
- package/dist/react/QueriesSection-DB12HMfQ.js +461 -0
- package/dist/react/QueriesTab-fyBB1u_Y.js +90 -0
- package/dist/react/RequestsSection-DTqB81ac.js +209 -0
- package/dist/react/RoutesSection-DJWa4NPV.js +74 -0
- package/dist/react/RoutesTab-D3l8TOpu.js +74 -0
- package/dist/react/TimelineSection-C4d-jRX1.js +158 -0
- package/dist/react/TimelineTab-C5TFaSmQ.js +193 -0
- package/dist/react/WaterfallChart-Cj73WdfM.js +100 -0
- package/dist/react/core/api-client.d.ts +73 -0
- package/dist/react/core/api-client.d.ts.map +1 -0
- package/dist/react/core/config-utils.d.ts +109 -0
- package/dist/react/core/config-utils.d.ts.map +1 -0
- package/dist/react/core/constants.d.ts +11 -0
- package/dist/react/core/constants.d.ts.map +1 -0
- package/dist/react/core/dashboard-api.d.ts +65 -0
- package/dist/react/core/dashboard-api.d.ts.map +1 -0
- package/dist/react/core/dashboard-data-controller.d.ts +157 -0
- package/dist/react/core/dashboard-data-controller.d.ts.map +1 -0
- package/dist/react/core/debug-data-controller.d.ts +89 -0
- package/dist/react/core/debug-data-controller.d.ts.map +1 -0
- package/dist/react/core/feature-detect.d.ts +67 -0
- package/dist/react/core/feature-detect.d.ts.map +1 -0
- package/dist/react/core/formatters.d.ts +189 -0
- package/dist/react/core/formatters.d.ts.map +1 -0
- package/dist/react/core/history-buffer.d.ts +23 -0
- package/dist/react/core/history-buffer.d.ts.map +1 -0
- package/dist/react/core/icons.d.ts +36 -0
- package/dist/react/core/icons.d.ts.map +1 -0
- package/dist/react/core/index.d.ts +39 -0
- package/dist/react/core/index.d.ts.map +1 -0
- package/dist/react/core/internals-utils.d.ts +71 -0
- package/dist/react/core/internals-utils.d.ts.map +1 -0
- package/dist/react/core/job-utils.d.ts +45 -0
- package/dist/react/core/job-utils.d.ts.map +1 -0
- package/dist/react/core/log-utils.d.ts +34 -0
- package/dist/react/core/log-utils.d.ts.map +1 -0
- package/dist/react/core/metrics.d.ts +41 -0
- package/dist/react/core/metrics.d.ts.map +1 -0
- package/dist/react/core/pagination.d.ts +128 -0
- package/dist/react/core/pagination.d.ts.map +1 -0
- package/dist/react/core/query-utils.d.ts +35 -0
- package/dist/react/core/query-utils.d.ts.map +1 -0
- package/dist/react/core/resizable-columns.d.ts +18 -0
- package/dist/react/core/resizable-columns.d.ts.map +1 -0
- package/dist/react/core/routes.d.ts +12 -0
- package/dist/react/core/routes.d.ts.map +1 -0
- package/dist/react/core/server-stats-controller.d.ts +106 -0
- package/dist/react/core/server-stats-controller.d.ts.map +1 -0
- package/dist/react/core/sparkline.d.ts +80 -0
- package/dist/react/core/sparkline.d.ts.map +1 -0
- package/dist/react/core/theme.d.ts +42 -0
- package/dist/react/core/theme.d.ts.map +1 -0
- package/dist/react/core/trace-utils.d.ts +62 -0
- package/dist/react/core/trace-utils.d.ts.map +1 -0
- package/dist/react/core/transmit-adapter.d.ts +59 -0
- package/dist/react/core/transmit-adapter.d.ts.map +1 -0
- package/dist/react/core/types.d.ts +619 -0
- package/dist/react/core/types.d.ts.map +1 -0
- package/dist/react/index-UdTfSvtO.js +1074 -0
- package/dist/react/index.js +18 -0
- package/dist/react/react/components/Dashboard/DashboardPage.d.ts +17 -0
- package/dist/react/react/components/Dashboard/DashboardPage.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts +14 -0
- package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +9 -0
- package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/DataTable.d.ts +27 -0
- package/dist/react/react/components/Dashboard/shared/DataTable.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts +17 -0
- package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/Pagination.d.ts +13 -0
- package/dist/react/react/components/Dashboard/shared/Pagination.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts +12 -0
- package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts +16 -0
- package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/DebugPanel.d.ts +16 -0
- package/dist/react/react/components/DebugPanel/DebugPanel.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts +8 -0
- package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts +8 -0
- package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts +14 -0
- package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts +12 -0
- package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts +9 -0
- package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts +8 -0
- package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts.map +1 -0
- package/dist/react/react/components/StatsBar/MetricCard.d.ts +21 -0
- package/dist/react/react/components/StatsBar/MetricCard.d.ts.map +1 -0
- package/dist/react/react/components/StatsBar/Sparkline.d.ts +15 -0
- package/dist/react/react/components/StatsBar/Sparkline.d.ts.map +1 -0
- package/dist/react/react/components/StatsBar/StatsBar.d.ts +22 -0
- package/dist/react/react/components/StatsBar/StatsBar.d.ts.map +1 -0
- package/dist/react/react/components/shared/Badge.d.ts +32 -0
- package/dist/react/react/components/shared/Badge.d.ts.map +1 -0
- package/dist/react/react/components/shared/ConfigContent.d.ts +13 -0
- package/dist/react/react/components/shared/ConfigContent.d.ts.map +1 -0
- package/dist/react/react/components/shared/InternalsContent.d.ts +10 -0
- package/dist/react/react/components/shared/InternalsContent.d.ts.map +1 -0
- package/dist/react/react/components/shared/JsonViewer.d.ts +12 -0
- package/dist/react/react/components/shared/JsonViewer.d.ts.map +1 -0
- package/dist/react/react/components/shared/ThemeToggle.d.ts +13 -0
- package/dist/react/react/components/shared/ThemeToggle.d.ts.map +1 -0
- package/dist/react/react/components/shared/Tooltip.d.ts +16 -0
- package/dist/react/react/components/shared/Tooltip.d.ts.map +1 -0
- package/dist/react/react/hooks/useApiClient.d.ts +10 -0
- package/dist/react/react/hooks/useApiClient.d.ts.map +1 -0
- package/dist/react/react/hooks/useDashboardApiBase.d.ts +19 -0
- package/dist/react/react/hooks/useDashboardApiBase.d.ts.map +1 -0
- package/dist/react/react/hooks/useDashboardData.d.ts +27 -0
- package/dist/react/react/hooks/useDashboardData.d.ts.map +1 -0
- package/dist/react/react/hooks/useDebugData.d.ts +17 -0
- package/dist/react/react/hooks/useDebugData.d.ts.map +1 -0
- package/dist/react/react/hooks/useFeatures.d.ts +13 -0
- package/dist/react/react/hooks/useFeatures.d.ts.map +1 -0
- package/dist/react/react/hooks/useResizableTable.d.ts +13 -0
- package/dist/react/react/hooks/useResizableTable.d.ts.map +1 -0
- package/dist/react/react/hooks/useServerStats.d.ts +21 -0
- package/dist/react/react/hooks/useServerStats.d.ts.map +1 -0
- package/dist/react/react/hooks/useTheme.d.ts +12 -0
- package/dist/react/react/hooks/useTheme.d.ts.map +1 -0
- package/dist/react/react/index.d.ts +14 -0
- package/dist/react/react/index.d.ts.map +1 -0
- package/dist/react/style.css +1 -0
- package/dist/react/useApiClient-BVtNCmnL.js +9 -0
- package/dist/react/useDashboardApiBase-Bi36pJ2L.js +14 -0
- package/dist/react/useResizableTable-CNJmACdt.js +13 -0
- package/dist/src/collectors/app_collector.d.ts.map +1 -1
- package/dist/src/collectors/app_collector.js +30 -2
- package/dist/src/collectors/auto_detect.d.ts +31 -0
- package/dist/src/collectors/auto_detect.d.ts.map +1 -0
- package/dist/src/collectors/auto_detect.js +120 -0
- package/dist/src/collectors/collector.d.ts +17 -0
- package/dist/src/collectors/collector.d.ts.map +1 -1
- package/dist/src/collectors/db_pool_collector.d.ts.map +1 -1
- package/dist/src/collectors/db_pool_collector.js +35 -1
- package/dist/src/collectors/http_collector.d.ts +4 -3
- package/dist/src/collectors/http_collector.d.ts.map +1 -1
- package/dist/src/collectors/http_collector.js +28 -11
- package/dist/src/collectors/index.d.ts +2 -0
- package/dist/src/collectors/index.d.ts.map +1 -1
- package/dist/src/collectors/index.js +1 -0
- package/dist/src/collectors/log_collector.d.ts +11 -4
- package/dist/src/collectors/log_collector.d.ts.map +1 -1
- package/dist/src/collectors/log_collector.js +51 -5
- package/dist/src/collectors/process_collector.d.ts.map +1 -1
- package/dist/src/collectors/process_collector.js +4 -0
- package/dist/src/collectors/queue_collector.d.ts.map +1 -1
- package/dist/src/collectors/queue_collector.js +55 -1
- package/dist/src/collectors/redis_collector.d.ts.map +1 -1
- package/dist/src/collectors/redis_collector.js +42 -3
- package/dist/src/collectors/system_collector.d.ts.map +1 -1
- package/dist/src/collectors/system_collector.js +4 -0
- package/dist/src/controller/api_controller.d.ts +101 -0
- package/dist/src/controller/api_controller.d.ts.map +1 -0
- package/dist/src/controller/api_controller.js +131 -0
- package/dist/src/controller/debug_controller.d.ts +19 -10
- package/dist/src/controller/debug_controller.d.ts.map +1 -1
- package/dist/src/controller/debug_controller.js +118 -101
- package/dist/src/core/theme.d.ts +42 -0
- package/dist/src/core/theme.d.ts.map +1 -0
- package/dist/src/core/theme.js +115 -0
- package/dist/src/dashboard/chart_aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/chart_aggregator.js +3 -2
- package/dist/src/dashboard/dashboard_controller.d.ts +10 -14
- package/dist/src/dashboard/dashboard_controller.d.ts.map +1 -1
- package/dist/src/dashboard/dashboard_controller.js +132 -250
- package/dist/src/dashboard/dashboard_store.d.ts +62 -19
- package/dist/src/dashboard/dashboard_store.d.ts.map +1 -1
- package/dist/src/dashboard/dashboard_store.js +242 -53
- package/dist/src/dashboard/integrations/cache_inspector.d.ts +19 -1
- package/dist/src/dashboard/integrations/cache_inspector.d.ts.map +1 -1
- package/dist/src/dashboard/integrations/config_inspector.d.ts +1 -1
- package/dist/src/dashboard/integrations/config_inspector.d.ts.map +1 -1
- package/dist/src/dashboard/integrations/config_inspector.js +3 -2
- package/dist/src/dashboard/integrations/queue_inspector.d.ts +55 -10
- package/dist/src/dashboard/integrations/queue_inspector.d.ts.map +1 -1
- package/dist/src/dashboard/integrations/queue_inspector.js +70 -24
- package/dist/src/dashboard/migrator.d.ts +5 -0
- package/dist/src/dashboard/migrator.d.ts.map +1 -1
- package/dist/src/dashboard/migrator.js +44 -9
- package/dist/src/dashboard/models/stats_event.d.ts +1 -1
- package/dist/src/dashboard/models/stats_event.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_log.d.ts +1 -1
- package/dist/src/dashboard/models/stats_log.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_query.d.ts +1 -1
- package/dist/src/dashboard/models/stats_query.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_saved_filter.d.ts +1 -1
- package/dist/src/dashboard/models/stats_saved_filter.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_trace.d.ts +2 -1
- package/dist/src/dashboard/models/stats_trace.d.ts.map +1 -1
- package/dist/src/data/data_access.d.ts +105 -0
- package/dist/src/data/data_access.d.ts.map +1 -0
- package/dist/src/data/data_access.js +310 -0
- package/dist/src/data/index.d.ts +3 -0
- package/dist/src/data/index.d.ts.map +1 -0
- package/dist/src/data/index.js +1 -0
- package/dist/src/debug/debug_store.d.ts +20 -1
- package/dist/src/debug/debug_store.d.ts.map +1 -1
- package/dist/src/debug/debug_store.js +43 -15
- package/dist/src/debug/email_collector.d.ts +6 -2
- package/dist/src/debug/email_collector.d.ts.map +1 -1
- package/dist/src/debug/email_collector.js +3 -0
- package/dist/src/debug/event_collector.d.ts +6 -2
- package/dist/src/debug/event_collector.d.ts.map +1 -1
- package/dist/src/debug/event_collector.js +12 -8
- package/dist/src/debug/query_collector.d.ts +6 -2
- package/dist/src/debug/query_collector.d.ts.map +1 -1
- package/dist/src/debug/query_collector.js +3 -0
- package/dist/src/debug/ring_buffer.d.ts +1 -0
- package/dist/src/debug/ring_buffer.d.ts.map +1 -1
- package/dist/src/debug/ring_buffer.js +5 -2
- package/dist/src/debug/route_inspector.d.ts +2 -2
- package/dist/src/debug/route_inspector.d.ts.map +1 -1
- package/dist/src/debug/route_inspector.js +4 -3
- package/dist/src/debug/trace_collector.d.ts +7 -3
- package/dist/src/debug/trace_collector.d.ts.map +1 -1
- package/dist/src/debug/trace_collector.js +7 -5
- package/dist/src/debug/types.d.ts +107 -2
- package/dist/src/debug/types.d.ts.map +1 -1
- package/dist/src/debug/types.js +1 -1
- package/dist/src/define_config.d.ts +49 -5
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js +361 -4
- package/dist/src/edge/bootstrap.d.ts +17 -0
- package/dist/src/edge/bootstrap.d.ts.map +1 -0
- package/dist/src/edge/bootstrap.js +29 -0
- package/dist/src/edge/client/dashboard.js +2 -3619
- package/dist/src/edge/client/debug-panel-deferred.js +1 -0
- package/dist/src/edge/client/debug-panel.js +1 -2140
- package/dist/src/edge/client/stats-bar.js +1 -801
- package/dist/src/edge/client-vue/dashboard.js +5 -0
- package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -0
- package/dist/src/edge/client-vue/debug-panel.js +4 -0
- package/dist/src/edge/client-vue/stats-bar.js +4 -0
- package/dist/src/edge/plugin.d.ts +35 -2
- package/dist/src/edge/plugin.d.ts.map +1 -1
- package/dist/src/edge/plugin.js +30 -66
- package/dist/src/edge/types.d.ts +46 -0
- package/dist/src/edge/types.d.ts.map +1 -0
- package/dist/src/edge/types.js +4 -0
- package/dist/src/edge/views/dashboard.edge +1 -358
- package/dist/src/edge/views/debug-panel.edge +2 -154
- package/dist/src/edge/views/stats-bar.edge +15 -48
- package/dist/src/engine/stats_engine.d.ts +18 -0
- package/dist/src/engine/stats_engine.d.ts.map +1 -1
- package/dist/src/engine/stats_engine.js +45 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/log_stream/log_stream_provider.d.ts.map +1 -1
- package/dist/src/log_stream/log_stream_provider.js +21 -4
- package/dist/src/log_stream/log_stream_service.d.ts +8 -1
- package/dist/src/log_stream/log_stream_service.d.ts.map +1 -1
- package/dist/src/log_stream/log_stream_service.js +27 -3
- package/dist/src/middleware/request_tracking_middleware.d.ts +1 -1
- package/dist/src/middleware/request_tracking_middleware.d.ts.map +1 -1
- package/dist/src/middleware/request_tracking_middleware.js +21 -6
- package/dist/src/prometheus/prometheus_collector.d.ts +2 -1
- package/dist/src/prometheus/prometheus_collector.d.ts.map +1 -1
- package/dist/src/provider/server_stats_provider.d.ts +100 -0
- package/dist/src/provider/server_stats_provider.d.ts.map +1 -1
- package/dist/src/provider/server_stats_provider.js +460 -104
- package/dist/src/routes/access_middleware.d.ts +2 -1
- package/dist/src/routes/access_middleware.d.ts.map +1 -1
- package/dist/src/routes/access_middleware.js +7 -1
- package/dist/src/routes/index.d.ts +4 -0
- package/dist/src/routes/index.d.ts.map +1 -0
- package/dist/src/routes/index.js +1 -0
- package/dist/src/routes/register_routes.d.ts +103 -0
- package/dist/src/routes/register_routes.d.ts.map +1 -0
- package/dist/src/routes/register_routes.js +356 -0
- package/dist/src/routes/router_types.d.ts +29 -0
- package/dist/src/routes/router_types.d.ts.map +1 -0
- package/dist/src/routes/router_types.js +1 -0
- package/dist/src/stubs/config.stub +12 -32
- package/dist/src/styles/components.css +1048 -0
- package/dist/src/{edge/client → styles}/dashboard.css +299 -736
- package/dist/src/{edge/client → styles}/debug-panel.css +117 -633
- package/dist/src/{edge/client → styles}/stats-bar.css +28 -10
- package/dist/src/styles/tokens.css +153 -0
- package/dist/src/styles/utilities.css +75 -0
- package/dist/src/types.d.ts +119 -16
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/app_import.d.ts +23 -0
- package/dist/src/utils/app_import.d.ts.map +1 -0
- package/dist/src/utils/app_import.js +44 -0
- package/dist/src/utils/json_helpers.d.ts +2 -2
- package/dist/src/utils/json_helpers.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts +17 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +27 -0
- package/dist/src/utils/mail_helpers.d.ts +1 -1
- package/dist/src/utils/mail_helpers.d.ts.map +1 -1
- package/dist/src/utils/mail_helpers.js +1 -1
- package/dist/vue/CacheSection-C788Yfai.js +149 -0
- package/dist/vue/CacheTab-BPisYYiQ.js +104 -0
- package/dist/vue/ConfigSection-CRzYxqW2.js +576 -0
- package/dist/vue/ConfigTab-C8cafGUj.js +361 -0
- package/dist/vue/CustomPaneTab-BJxT5Dp7.js +172 -0
- package/dist/vue/EmailsSection-C8JFMtW7.js +206 -0
- package/dist/vue/EmailsTab-DhFhoNmU.js +157 -0
- package/dist/vue/EventsSection-C4wXUgxG.js +107 -0
- package/dist/vue/EventsTab-DQ4Nd6AK.js +97 -0
- package/dist/vue/FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js +62 -0
- package/dist/vue/InternalsSection-BJUXE-5F.js +468 -0
- package/dist/vue/InternalsTab-DEMjqtlw.js +471 -0
- package/dist/vue/JobsSection-CsKWTjgN.js +187 -0
- package/dist/vue/JobsTab-BCvhOARO.js +117 -0
- package/dist/vue/JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js +67 -0
- package/dist/vue/LogsSection-BFVjSZ24.js +227 -0
- package/dist/vue/LogsTab-DpEQ7euu.js +122 -0
- package/dist/vue/OverviewSection-CbMdAido.js +849 -0
- package/dist/vue/PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js +50 -0
- package/dist/vue/QueriesSection-BPiv7u3r.js +429 -0
- package/dist/vue/QueriesTab-C8_7oprC.js +107 -0
- package/dist/vue/RequestsSection-LtImH4rD.js +243 -0
- package/dist/vue/RoutesSection-CrxOxmzx.js +106 -0
- package/dist/vue/RoutesTab-Dz0MkZuF.js +80 -0
- package/dist/vue/TimelineSection-DLxMW2J_.js +186 -0
- package/dist/vue/TimelineTab-Db6lKKsD.js +250 -0
- package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +118 -0
- package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts +18 -0
- package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts +3 -0
- package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts +3 -0
- package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts +3 -0
- package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +45 -0
- package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts +11 -0
- package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts +29 -0
- package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts +12 -0
- package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts +11 -0
- package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts +10 -0
- package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts +21 -0
- package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts +11 -0
- package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts +11 -0
- package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts +11 -0
- package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts +13 -0
- package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts +15 -0
- package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +15 -0
- package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts.map +1 -0
- package/dist/vue/components/StatsBar/MetricCard.vue.d.ts +19 -0
- package/dist/vue/components/StatsBar/MetricCard.vue.d.ts.map +1 -0
- package/dist/vue/components/StatsBar/Sparkline.vue.d.ts +17 -0
- package/dist/vue/components/StatsBar/Sparkline.vue.d.ts.map +1 -0
- package/dist/vue/components/StatsBar/StatsBar.vue.d.ts +22 -0
- package/dist/vue/components/StatsBar/StatsBar.vue.d.ts.map +1 -0
- package/dist/vue/components/shared/JsonViewer.vue.d.ts +13 -0
- package/dist/vue/components/shared/JsonViewer.vue.d.ts.map +1 -0
- package/dist/vue/components/shared/ThemeToggle.vue.d.ts +8 -0
- package/dist/vue/components/shared/ThemeToggle.vue.d.ts.map +1 -0
- package/dist/vue/composables/useApiClient.d.ts +9 -0
- package/dist/vue/composables/useApiClient.d.ts.map +1 -0
- package/dist/vue/composables/useDashboardData.d.ts +53 -0
- package/dist/vue/composables/useDashboardData.d.ts.map +1 -0
- package/dist/vue/composables/useDebugData.d.ts +25 -0
- package/dist/vue/composables/useDebugData.d.ts.map +1 -0
- package/dist/vue/composables/useFeatures.d.ts +80 -0
- package/dist/vue/composables/useFeatures.d.ts.map +1 -0
- package/dist/vue/composables/useResizableTable.d.ts +16 -0
- package/dist/vue/composables/useResizableTable.d.ts.map +1 -0
- package/dist/vue/composables/useServerStats.d.ts +104 -0
- package/dist/vue/composables/useServerStats.d.ts.map +1 -0
- package/dist/vue/composables/useTheme.d.ts +6 -0
- package/dist/vue/composables/useTheme.d.ts.map +1 -0
- package/dist/vue/index-qCQpBftQ.js +1233 -0
- package/dist/vue/index.d.ts +10 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +11 -0
- package/dist/vue/style.css +1 -0
- package/dist/vue/useApiClient-BQQ9CF-q.js +10 -0
- package/dist/vue/useResizableTable-BoivAevK.js +17 -0
- package/package.json +72 -10
- package/dist/src/dashboard/dashboard_routes.d.ts +0 -16
- package/dist/src/dashboard/dashboard_routes.d.ts.map +0 -1
- package/dist/src/dashboard/dashboard_routes.js +0 -77
- package/dist/src/routes/debug_routes.d.ts +0 -14
- package/dist/src/routes/debug_routes.d.ts.map +0 -1
- package/dist/src/routes/debug_routes.js +0 -42
- package/dist/src/routes/stats_routes.d.ts +0 -14
- package/dist/src/routes/stats_routes.d.ts.map +0 -1
- package/dist/src/routes/stats_routes.js +0 -27
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ Drop a single Edge tag into your layout and get a live stats bar showing CPU, me
|
|
|
13
13
|
|
|
14
14
|
Zero frontend dependencies. Zero build step. Just `@serverStats()` and go.
|
|
15
15
|
|
|
16
|
+
**New (alpha):** Native [React & Vue components](#react--vue-inertiajs--alpha) for Inertia.js apps — same features, framework-native.
|
|
17
|
+
|
|
16
18
|

|
|
17
19
|
|
|
18
20
|
## Screenshots
|
|
@@ -42,7 +44,8 @@ Zero frontend dependencies. Zero build step. Just `@serverStats()` and go.
|
|
|
42
44
|
- **Visibility control** -- show only to admins, specific roles, or in dev mode
|
|
43
45
|
- **SSE broadcasting** -- real-time updates via AdonisJS Transmit
|
|
44
46
|
- **Prometheus export** -- expose all metrics as Prometheus gauges
|
|
45
|
-
- **Self-contained** -- inline HTML/CSS/JS Edge tag, no
|
|
47
|
+
- **Self-contained** -- inline HTML/CSS/JS Edge tag, no external assets
|
|
48
|
+
- **React & Vue support (alpha)** -- native Inertia.js components with the same features as Edge
|
|
46
49
|
- **Graceful degradation** -- missing optional dependencies are handled automatically
|
|
47
50
|
- **Theme support** -- dark and light themes across dashboard, debug panel, and stats bar with system preference detection and manual toggle
|
|
48
51
|
|
|
@@ -82,14 +85,26 @@ server.use([() => import('adonisjs-server-stats/middleware')])
|
|
|
82
85
|
```ts
|
|
83
86
|
// config/server_stats.ts
|
|
84
87
|
import { defineConfig } from 'adonisjs-server-stats'
|
|
85
|
-
|
|
88
|
+
|
|
89
|
+
export default defineConfig({})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
That's it -- zero config required. Collectors are auto-detected from your installed packages (Lucid, Redis, BullMQ, etc.) and enabled automatically. All other options have sensible defaults.
|
|
93
|
+
|
|
94
|
+
**Common setup** -- add access control and enable the toolbar/dashboard:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
// config/server_stats.ts
|
|
98
|
+
import { defineConfig } from 'adonisjs-server-stats'
|
|
86
99
|
|
|
87
100
|
export default defineConfig({
|
|
88
|
-
|
|
101
|
+
authorize: (ctx) => ctx.auth?.user?.role === 'admin',
|
|
102
|
+
toolbar: true,
|
|
103
|
+
dashboard: true,
|
|
89
104
|
})
|
|
90
105
|
```
|
|
91
106
|
|
|
92
|
-
|
|
107
|
+
**Full control** -- override auto-detection with explicit collectors:
|
|
93
108
|
|
|
94
109
|
```ts
|
|
95
110
|
// config/server_stats.ts
|
|
@@ -107,39 +122,13 @@ import {
|
|
|
107
122
|
} from 'adonisjs-server-stats/collectors'
|
|
108
123
|
|
|
109
124
|
export default defineConfig({
|
|
110
|
-
|
|
111
|
-
intervalMs: 3000,
|
|
112
|
-
|
|
113
|
-
// Real-time transport: 'transmit' for SSE via @adonisjs/transmit, 'none' for polling only
|
|
114
|
-
transport: 'transmit',
|
|
115
|
-
|
|
116
|
-
// Transmit channel name clients subscribe to
|
|
117
|
-
channelName: 'admin/server-stats',
|
|
118
|
-
|
|
119
|
-
// HTTP endpoint that serves the latest stats snapshot (set to false to disable)
|
|
120
|
-
endpoint: '/admin/api/server-stats',
|
|
121
|
-
|
|
125
|
+
pollInterval: 3000,
|
|
122
126
|
collectors: [
|
|
123
|
-
// CPU usage, event loop lag, heap/RSS memory, uptime, Node.js version
|
|
124
127
|
processCollector(),
|
|
125
|
-
|
|
126
|
-
// OS load averages, total/free system memory, system uptime
|
|
127
128
|
systemCollector(),
|
|
128
|
-
|
|
129
|
-
// Requests/sec, avg response time, error rate, active connections
|
|
130
|
-
// maxRecords: size of the circular buffer for request tracking
|
|
131
129
|
httpCollector({ maxRecords: 10_000 }),
|
|
132
|
-
|
|
133
|
-
// Lucid connection pool: used/free/pending/max connections
|
|
134
|
-
// Requires @adonisjs/lucid
|
|
135
130
|
dbPoolCollector({ connectionName: 'postgres' }),
|
|
136
|
-
|
|
137
|
-
// Redis server stats: memory, connected clients, keys, hit rate
|
|
138
|
-
// Requires @adonisjs/redis
|
|
139
131
|
redisCollector(),
|
|
140
|
-
|
|
141
|
-
// BullMQ queue stats: active/waiting/delayed/failed jobs
|
|
142
|
-
// Requires bullmq -- connects directly to Redis (not via @adonisjs/redis)
|
|
143
132
|
queueCollector({
|
|
144
133
|
queueName: 'default',
|
|
145
134
|
connection: {
|
|
@@ -148,12 +137,7 @@ export default defineConfig({
|
|
|
148
137
|
password: env.get('QUEUE_REDIS_PASSWORD'),
|
|
149
138
|
},
|
|
150
139
|
}),
|
|
151
|
-
|
|
152
|
-
// Log file stats: errors/warnings in a 5-minute window, entries/minute
|
|
153
|
-
logCollector({ logPath: 'logs/adonisjs.log' }),
|
|
154
|
-
|
|
155
|
-
// App-level metrics: online users, pending webhooks, pending emails
|
|
156
|
-
// Requires @adonisjs/lucid
|
|
140
|
+
logCollector(),
|
|
157
141
|
appCollector(),
|
|
158
142
|
],
|
|
159
143
|
})
|
|
@@ -167,7 +151,7 @@ That's it for setup -- **all API routes are auto-registered by the package**. No
|
|
|
167
151
|
[server-stats] auto-registered routes: /admin/api/server-stats, /admin/api/debug/*, /__stats/*
|
|
168
152
|
```
|
|
169
153
|
|
|
170
|
-
All routes are gated by the `
|
|
154
|
+
All routes are gated by the `authorize` callback if configured (see [Visibility Control](#visibility-control-authorize)).
|
|
171
155
|
|
|
172
156
|
**Edge** (add before `</body>`):
|
|
173
157
|
|
|
@@ -179,44 +163,96 @@ All routes are gated by the `shouldShow` callback if configured (see [Visibility
|
|
|
179
163
|
|
|
180
164
|
## Config Reference
|
|
181
165
|
|
|
182
|
-
### `ServerStatsConfig`
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
| `
|
|
203
|
-
| `
|
|
204
|
-
| `
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
|
211
|
-
|
|
|
212
|
-
| `
|
|
213
|
-
| `
|
|
214
|
-
|
|
166
|
+
### `ServerStatsConfig` (recommended)
|
|
167
|
+
|
|
168
|
+
All fields are optional. `defineConfig({})` works with zero configuration.
|
|
169
|
+
|
|
170
|
+
| Option | Type | Default | Description |
|
|
171
|
+
| --------------- | --------------------------------- | --------------------------- | ---------------------------------------------------------------- |
|
|
172
|
+
| `pollInterval` | `number` | `3000` | Collection + broadcast interval (ms) |
|
|
173
|
+
| `collectors` | `'auto' \| MetricCollector[]` | `'auto'` | `'auto'` probes installed packages; or pass an explicit array |
|
|
174
|
+
| `realtime` | `boolean` | `true` | `true` = SSE via Transmit, `false` = poll-only |
|
|
175
|
+
| `statsEndpoint` | `string \| false` | `'/admin/api/server-stats'` | HTTP endpoint. `false` to disable. |
|
|
176
|
+
| `authorize` | `(ctx) => boolean` | -- | Per-request visibility guard |
|
|
177
|
+
| `onStats` | `(stats) => void` | -- | Callback after each collection tick |
|
|
178
|
+
| `toolbar` | `boolean \| ToolbarConfig` | -- | `true` to enable with defaults, or pass a `ToolbarConfig` object |
|
|
179
|
+
| `dashboard` | `boolean \| DashboardConfig` | -- | `true` to enable at `/__stats`, or pass a `DashboardConfig` |
|
|
180
|
+
| `advanced` | `AdvancedConfig` | -- | Rarely-needed options (channel name, db path, buffer sizes, etc) |
|
|
181
|
+
|
|
182
|
+
### `ToolbarConfig`
|
|
183
|
+
|
|
184
|
+
| Option | Type | Default | Description |
|
|
185
|
+
| -------------------- | ---------- | ------------------------------------------------- | ----------------------------------------------- |
|
|
186
|
+
| `slowQueryThreshold` | `number` | `100` | Slow query threshold (ms) |
|
|
187
|
+
| `tracing` | `boolean` | `false` | Enable per-request tracing with timeline |
|
|
188
|
+
| `persist` | `boolean` | `false` | Persist debug data to disk across restarts |
|
|
189
|
+
| `panes` | `DebugPane[]` | -- | Custom debug panel tabs |
|
|
190
|
+
| `excludeFromTracing` | `string[]` | `['/admin/api/debug', '/admin/api/server-stats']` | URL prefixes to exclude from tracing/persistence |
|
|
191
|
+
|
|
192
|
+
### `DashboardConfig`
|
|
193
|
+
|
|
194
|
+
| Option | Type | Default | Description |
|
|
195
|
+
| --------------- | -------- | ------------ | -------------------------------------- |
|
|
196
|
+
| `path` | `string` | `'/__stats'` | URL path for the dashboard page |
|
|
197
|
+
| `retentionDays` | `number` | `7` | Days to keep historical data in SQLite |
|
|
198
|
+
|
|
199
|
+
### `AdvancedConfig`
|
|
200
|
+
|
|
201
|
+
| Option | Type | Default | Description |
|
|
202
|
+
| --------------- | ------------------- | -------------------------------------------- | ----------------------------------------------- |
|
|
203
|
+
| `skipInTest` | `boolean` | `true` | Skip collection during tests |
|
|
204
|
+
| `channelName` | `string` | `'admin/server-stats'` | Transmit channel name |
|
|
205
|
+
| `debugEndpoint` | `string` | `'/admin/api/debug'` | Base path for debug toolbar API endpoints |
|
|
206
|
+
| `renderer` | `'preact' \| 'vue'` | `'preact'` | Client-side rendering library for Edge |
|
|
207
|
+
| `dbPath` | `string` | `'.adonisjs/server-stats/dashboard.sqlite3'` | Path to the SQLite database file |
|
|
208
|
+
| `persistPath` | `string` | `'.adonisjs/server-stats/debug-data.json'` | Path for persisted debug data |
|
|
209
|
+
| `maxQueries` | `number` | `500` | Max SQL queries to buffer |
|
|
210
|
+
| `maxEvents` | `number` | `200` | Max events to buffer |
|
|
211
|
+
| `maxEmails` | `number` | `100` | Max emails to buffer |
|
|
212
|
+
| `maxTraces` | `number` | `200` | Max request traces to buffer |
|
|
213
|
+
|
|
214
|
+
### Legacy config (deprecated)
|
|
215
|
+
|
|
216
|
+
The following field names still work but will show deprecation warnings at boot. They will be removed in the next major version.
|
|
217
|
+
|
|
218
|
+
| Legacy Name | Replacement | Notes |
|
|
219
|
+
| ------------- | ------------------------------- | -------------------------------------------- |
|
|
220
|
+
| `intervalMs` | `pollInterval` | Same type and default |
|
|
221
|
+
| `transport` | `realtime` | `'transmit'` = `true`, `'none'` = `false` |
|
|
222
|
+
| `channelName` | `advanced.channelName` | Same type and default |
|
|
223
|
+
| `endpoint` | `statsEndpoint` | Same type and default |
|
|
224
|
+
| `shouldShow` | `authorize` | Same type and default |
|
|
225
|
+
| `skipInTest` | `advanced.skipInTest` | Same type and default |
|
|
226
|
+
| `devToolbar` | `toolbar` + `dashboard` + `advanced` | Split into focused config objects |
|
|
227
|
+
|
|
228
|
+
### `DevToolbarOptions` (internal)
|
|
229
|
+
|
|
230
|
+
> **Note:** This is the internal, fully-expanded format. Most users should prefer the new `toolbar`, `dashboard`, and `advanced` options above -- they map to these fields automatically.
|
|
231
|
+
|
|
232
|
+
| Option | Type | Default | Description |
|
|
233
|
+
| ---------------------- | ------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
234
|
+
| `enabled` | `boolean` | `false` | Enable the dev toolbar |
|
|
235
|
+
| `maxQueries` | `number` | `500` | Max SQL queries to buffer |
|
|
236
|
+
| `maxEvents` | `number` | `200` | Max events to buffer |
|
|
237
|
+
| `maxEmails` | `number` | `100` | Max emails to buffer |
|
|
238
|
+
| `slowQueryThresholdMs` | `number` | `100` | Slow query threshold (ms) |
|
|
239
|
+
| `persistDebugData` | `boolean \| string` | `false` | Persist debug data to disk across restarts. `true` writes to `.adonisjs/server-stats/debug-data.json`, or pass a custom path. |
|
|
240
|
+
| `tracing` | `boolean` | `false` | Enable per-request tracing with timeline visualization |
|
|
241
|
+
| `maxTraces` | `number` | `200` | Max request traces to buffer |
|
|
242
|
+
| `dashboard` | `boolean` | `false` | Enable the full-page dashboard (requires `better-sqlite3`) |
|
|
243
|
+
| `dashboardPath` | `string` | `'/__stats'` | URL path for the dashboard page |
|
|
244
|
+
| `retentionDays` | `number` | `7` | Days to keep historical data in SQLite |
|
|
245
|
+
| `dbPath` | `string` | `'.adonisjs/server-stats/dashboard.sqlite3'` | Path to the SQLite database file (relative to app root) |
|
|
246
|
+
| `debugEndpoint` | `string` | `'/admin/api/debug'` | Base path for the debug toolbar API endpoints |
|
|
247
|
+
| `excludeFromTracing` | `string[]` | `['/admin/api/debug', '/admin/api/server-stats']` | URL prefixes to exclude from tracing and dashboard persistence. Requests still count toward HTTP metrics but won't appear in the timeline or be stored. The stats endpoint is always excluded automatically. |
|
|
248
|
+
| `panes` | `DebugPane[]` | -- | Custom debug panel tabs |
|
|
215
249
|
|
|
216
250
|
---
|
|
217
251
|
|
|
218
252
|
## Collectors
|
|
219
253
|
|
|
254
|
+
> When `collectors` is `'auto'` (the default), the package probes installed packages at boot and enables matching collectors automatically. On startup you'll see a log showing all 8 collectors with a checkmark or cross and which packages were found or missing. You only need to specify collectors explicitly if you want to customize their options.
|
|
255
|
+
|
|
220
256
|
Each collector is a factory function that returns a `MetricCollector`. All collectors run in parallel each tick; missing peer dependencies are handled gracefully (the collector returns defaults instead of crashing).
|
|
221
257
|
|
|
222
258
|
### Built-in Collectors
|
|
@@ -229,7 +265,7 @@ Each collector is a factory function that returns a `MetricCollector`. All colle
|
|
|
229
265
|
| `dbPoolCollector(opts?)` | Pool used/free/pending/max connections | optional | `@adonisjs/lucid` |
|
|
230
266
|
| `redisCollector()` | Status, memory, clients, keys, hit rate | none | `@adonisjs/redis` |
|
|
231
267
|
| `queueCollector(opts)` | Active/waiting/delayed/failed jobs, worker count | **required** | `bullmq` |
|
|
232
|
-
| `logCollector(opts)`
|
|
268
|
+
| `logCollector(opts?)` | Errors/warnings/entries (5m window), entries/minute | optional | -- |
|
|
233
269
|
| `appCollector()` | Online users, pending webhooks, pending emails | none | `@adonisjs/lucid` |
|
|
234
270
|
|
|
235
271
|
### Collector Options
|
|
@@ -253,9 +289,11 @@ queueCollector({
|
|
|
253
289
|
},
|
|
254
290
|
})
|
|
255
291
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
292
|
+
// Zero-config: hooks into AdonisJS Pino logger automatically
|
|
293
|
+
logCollector()
|
|
294
|
+
|
|
295
|
+
// Or file-based fallback:
|
|
296
|
+
logCollector({ logPath: 'logs/adonisjs.log' })
|
|
259
297
|
```
|
|
260
298
|
|
|
261
299
|
### Custom Collectors
|
|
@@ -301,101 +339,104 @@ interface MetricCollector {
|
|
|
301
339
|
|
|
302
340
|
---
|
|
303
341
|
|
|
304
|
-
## Visibility Control (`
|
|
342
|
+
## Visibility Control (`authorize`)
|
|
305
343
|
|
|
306
|
-
Use `
|
|
344
|
+
Use `authorize` to control who can see the stats bar and access all auto-registered API routes (stats, debug, dashboard). The callback receives the AdonisJS `HttpContext` and should return `true` to allow access, `false` to deny (403).
|
|
307
345
|
|
|
308
|
-
Because `
|
|
346
|
+
Because `authorize` runs **after** middleware (including auth), you have full access to `ctx.auth`.
|
|
309
347
|
|
|
310
348
|
```ts
|
|
311
349
|
export default defineConfig({
|
|
312
350
|
// Only show in development
|
|
313
|
-
|
|
351
|
+
authorize: () => env.get('NODE_ENV'),
|
|
314
352
|
})
|
|
315
353
|
```
|
|
316
354
|
|
|
317
355
|
```ts
|
|
318
356
|
export default defineConfig({
|
|
319
357
|
// Only show for logged-in admin users
|
|
320
|
-
|
|
358
|
+
authorize: (ctx) => ctx.auth?.user?.isAdmin === true,
|
|
321
359
|
})
|
|
322
360
|
```
|
|
323
361
|
|
|
324
362
|
```ts
|
|
325
363
|
export default defineConfig({
|
|
326
364
|
// Only show for specific roles
|
|
327
|
-
|
|
365
|
+
authorize: (ctx) => {
|
|
328
366
|
const role = ctx.auth?.user?.role
|
|
329
367
|
return role === 'admin' || role === 'superadmin'
|
|
330
368
|
},
|
|
331
369
|
})
|
|
332
370
|
```
|
|
333
371
|
|
|
334
|
-
> **Tip:** When `
|
|
372
|
+
> **Tip:** When `authorize` is not set, the bar and all routes are accessible to everyone. In production you almost always want to set this.
|
|
373
|
+
>
|
|
374
|
+
> **Migration note:** `shouldShow` still works as a deprecated alias for `authorize`. Both have the same signature and behavior.
|
|
335
375
|
|
|
336
376
|
---
|
|
337
377
|
|
|
338
378
|
## Auto-Registered Routes
|
|
339
379
|
|
|
340
|
-
All API routes are registered automatically by the package during `boot()` -- no manual controllers or route definitions needed. Each route group is gated by the `
|
|
380
|
+
All API routes are registered automatically by the package during `boot()` -- no manual controllers or route definitions needed. Each route group is gated by the `authorize` callback if configured.
|
|
341
381
|
|
|
342
382
|
### Stats bar endpoint
|
|
343
383
|
|
|
344
|
-
Registered when `
|
|
384
|
+
Registered when `statsEndpoint` is a string (default: `/admin/api/server-stats`). Returns the latest stats snapshot as JSON.
|
|
345
385
|
|
|
346
386
|
### Debug toolbar routes
|
|
347
387
|
|
|
348
|
-
Registered when `
|
|
388
|
+
Registered when `toolbar` is enabled. Base path configurable via `advanced.debugEndpoint` (default: `/admin/api/debug`).
|
|
349
389
|
|
|
350
|
-
| Method | Path
|
|
351
|
-
|
|
352
|
-
| GET
|
|
353
|
-
| GET
|
|
354
|
-
| GET
|
|
355
|
-
| GET
|
|
356
|
-
| GET
|
|
357
|
-
| GET
|
|
358
|
-
| GET
|
|
359
|
-
| GET
|
|
390
|
+
| Method | Path | Description |
|
|
391
|
+
| ------ | --------------------- | ------------------------------- |
|
|
392
|
+
| GET | `/queries` | SQL queries with summary stats |
|
|
393
|
+
| GET | `/events` | Application events |
|
|
394
|
+
| GET | `/routes` | Registered route table |
|
|
395
|
+
| GET | `/logs` | Log file entries (last 256KB) |
|
|
396
|
+
| GET | `/emails` | Captured emails (stripped HTML) |
|
|
397
|
+
| GET | `/emails/:id/preview` | Email HTML preview |
|
|
398
|
+
| GET | `/traces` | Request traces |
|
|
399
|
+
| GET | `/traces/:id` | Trace detail with spans |
|
|
360
400
|
|
|
361
401
|
### Dashboard routes
|
|
362
402
|
|
|
363
|
-
Registered when `
|
|
364
|
-
|
|
365
|
-
| Method | Path
|
|
366
|
-
|
|
367
|
-
| GET
|
|
368
|
-
| GET
|
|
369
|
-
| GET
|
|
370
|
-
| GET
|
|
371
|
-
| GET
|
|
372
|
-
| GET
|
|
373
|
-
| GET
|
|
374
|
-
| GET
|
|
375
|
-
| GET
|
|
376
|
-
| GET
|
|
377
|
-
| GET
|
|
378
|
-
| GET
|
|
379
|
-
| GET
|
|
380
|
-
| GET
|
|
381
|
-
| GET
|
|
382
|
-
| GET
|
|
383
|
-
| GET
|
|
384
|
-
| GET
|
|
385
|
-
| GET
|
|
386
|
-
| POST
|
|
387
|
-
| GET
|
|
388
|
-
| GET
|
|
389
|
-
| POST
|
|
390
|
-
| DELETE | `/api/filters/:id`
|
|
403
|
+
Registered when `dashboard` is enabled. Base path configurable via `dashboard.path` (default: `/__stats`).
|
|
404
|
+
|
|
405
|
+
| Method | Path | Description |
|
|
406
|
+
| ------ | -------------------------- | --------------------------------- |
|
|
407
|
+
| GET | `/` | Dashboard page (HTML) |
|
|
408
|
+
| GET | `/api/overview` | Overview metrics |
|
|
409
|
+
| GET | `/api/overview/chart` | Time-series chart data |
|
|
410
|
+
| GET | `/api/requests` | Paginated request history |
|
|
411
|
+
| GET | `/api/requests/:id` | Request detail with queries/trace |
|
|
412
|
+
| GET | `/api/queries` | Paginated query list |
|
|
413
|
+
| GET | `/api/queries/grouped` | Queries grouped by normalized SQL |
|
|
414
|
+
| GET | `/api/queries/:id/explain` | EXPLAIN plan for a query |
|
|
415
|
+
| GET | `/api/events` | Paginated event list |
|
|
416
|
+
| GET | `/api/routes` | Route table |
|
|
417
|
+
| GET | `/api/logs` | Paginated log entries |
|
|
418
|
+
| GET | `/api/emails` | Paginated email list |
|
|
419
|
+
| GET | `/api/emails/:id/preview` | Email HTML preview |
|
|
420
|
+
| GET | `/api/traces` | Paginated trace list |
|
|
421
|
+
| GET | `/api/traces/:id` | Trace detail with spans |
|
|
422
|
+
| GET | `/api/cache` | Cache stats and key listing |
|
|
423
|
+
| GET | `/api/cache/:key` | Cache key detail |
|
|
424
|
+
| GET | `/api/jobs` | Job queue overview |
|
|
425
|
+
| GET | `/api/jobs/:id` | Job detail |
|
|
426
|
+
| POST | `/api/jobs/:id/retry` | Retry a failed job |
|
|
427
|
+
| GET | `/api/config` | App config (secrets redacted) |
|
|
428
|
+
| GET | `/api/filters` | Saved filters |
|
|
429
|
+
| POST | `/api/filters` | Create saved filter |
|
|
430
|
+
| DELETE | `/api/filters/:id` | Delete saved filter |
|
|
391
431
|
|
|
392
432
|
### Global middleware note
|
|
393
433
|
|
|
394
434
|
Auto-registered routes bypass route-level middleware but are still subject to global/server middleware. If you have auth middleware (like `silentAuth`) registered globally, each polling request will trigger a DB query every few seconds.
|
|
395
435
|
|
|
396
436
|
To avoid this, either:
|
|
437
|
+
|
|
397
438
|
- Move auth middleware to a named route group instead of global middleware
|
|
398
|
-
- Use the `
|
|
439
|
+
- Use the `authorize` callback for access control (recommended)
|
|
399
440
|
|
|
400
441
|
---
|
|
401
442
|
|
|
@@ -423,10 +464,155 @@ Features:
|
|
|
423
464
|
|
|
424
465
|
---
|
|
425
466
|
|
|
467
|
+
## React & Vue (Inertia.js) — Alpha
|
|
468
|
+
|
|
469
|
+
> **Alpha feature.** The React and Vue integrations are new and may have rough edges. Bug reports and feedback are very welcome — please [open an issue](https://github.com/simulieren/adonisjs-server-stats/issues).
|
|
470
|
+
|
|
471
|
+
If you're using **Inertia.js** with React or Vue instead of Edge templates, you can drop in the same stats bar, debug panel, and dashboard as fully native components. Same data, same styling, same features — just framework-native.
|
|
472
|
+
|
|
473
|
+
### Install
|
|
474
|
+
|
|
475
|
+
No extra packages needed. The components ship inside the main package:
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
npm install adonisjs-server-stats
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
Peer dependencies (all optional — install what you use):
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# React
|
|
485
|
+
npm install react react-dom
|
|
486
|
+
|
|
487
|
+
# Vue
|
|
488
|
+
npm install vue
|
|
489
|
+
|
|
490
|
+
# Real-time updates (optional — falls back to polling)
|
|
491
|
+
npm install @adonisjs/transmit-client
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### React
|
|
495
|
+
|
|
496
|
+
```tsx
|
|
497
|
+
import { ServerStatsBar, DebugPanel, DashboardPage } from 'adonisjs-server-stats/react'
|
|
498
|
+
import 'adonisjs-server-stats/react/css'
|
|
499
|
+
|
|
500
|
+
// Stats bar — drop into your layout
|
|
501
|
+
<ServerStatsBar endpoint="/admin/api/server-stats" intervalMs={3000} />
|
|
502
|
+
|
|
503
|
+
// Debug panel — same layout, add below the stats bar
|
|
504
|
+
<DebugPanel endpoint="/admin/api/debug" />
|
|
505
|
+
|
|
506
|
+
// Dashboard — use as a full Inertia page
|
|
507
|
+
<DashboardPage endpoint="/__stats/api" />
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
Available hooks:
|
|
511
|
+
|
|
512
|
+
```tsx
|
|
513
|
+
import {
|
|
514
|
+
useServerStats,
|
|
515
|
+
useDebugData,
|
|
516
|
+
useDashboardData,
|
|
517
|
+
useTheme,
|
|
518
|
+
useFeatures,
|
|
519
|
+
} from 'adonisjs-server-stats/react'
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Vue
|
|
523
|
+
|
|
524
|
+
```vue
|
|
525
|
+
<script setup>
|
|
526
|
+
import { ServerStatsBar, DebugPanel, DashboardPage } from 'adonisjs-server-stats/vue'
|
|
527
|
+
import 'adonisjs-server-stats/vue/css'
|
|
528
|
+
</script>
|
|
529
|
+
|
|
530
|
+
<template>
|
|
531
|
+
<!-- Stats bar — drop into your layout -->
|
|
532
|
+
<ServerStatsBar endpoint="/admin/api/server-stats" :interval-ms="3000" />
|
|
533
|
+
|
|
534
|
+
<!-- Debug panel -->
|
|
535
|
+
<DebugPanel endpoint="/admin/api/debug" />
|
|
536
|
+
|
|
537
|
+
<!-- Dashboard — use as a full Inertia page -->
|
|
538
|
+
<DashboardPage endpoint="/__stats/api" />
|
|
539
|
+
</template>
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Available composables:
|
|
543
|
+
|
|
544
|
+
```ts
|
|
545
|
+
import {
|
|
546
|
+
useServerStats,
|
|
547
|
+
useDebugData,
|
|
548
|
+
useDashboardData,
|
|
549
|
+
useTheme,
|
|
550
|
+
useFeatures,
|
|
551
|
+
} from 'adonisjs-server-stats/vue'
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### Shared building blocks (React)
|
|
555
|
+
|
|
556
|
+
For advanced composition, React also exports lower-level UI primitives:
|
|
557
|
+
|
|
558
|
+
```tsx
|
|
559
|
+
import {
|
|
560
|
+
ThemeToggle,
|
|
561
|
+
Badge,
|
|
562
|
+
MethodBadge,
|
|
563
|
+
StatusBadge,
|
|
564
|
+
JsonViewer,
|
|
565
|
+
Tooltip,
|
|
566
|
+
} from 'adonisjs-server-stats/react'
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
### Auth & visibility
|
|
570
|
+
|
|
571
|
+
The components auto-detect your auth setup:
|
|
572
|
+
|
|
573
|
+
- **Cookie auth** (default Inertia setup) — requests use `credentials: 'include'` automatically
|
|
574
|
+
- **Bearer token** — pass `authToken` as a prop to any component
|
|
575
|
+
|
|
576
|
+
The same `authorize` callback you configure on the server gates all API routes. If a user isn't authorized, the components detect the 403 and hide themselves.
|
|
577
|
+
|
|
578
|
+
### Real-time updates
|
|
579
|
+
|
|
580
|
+
If `@adonisjs/transmit-client` is installed, the stats bar subscribes to SSE for instant updates. Otherwise it falls back to polling at the configured interval. No configuration needed — it just works.
|
|
581
|
+
|
|
582
|
+
### Theme support
|
|
583
|
+
|
|
584
|
+
The React and Vue components share the same theme system as Edge. Dark/light preference syncs across all three UIs via `localStorage`, including cross-tab sync.
|
|
585
|
+
|
|
586
|
+
### Known limitations (alpha)
|
|
587
|
+
|
|
588
|
+
- The dashboard page is large — lazy-loading helps but initial bundle may be significant
|
|
589
|
+
- Some edge cases in custom pane rendering may not be fully covered yet
|
|
590
|
+
- Error boundaries are minimal — a bad API response may cause a blank panel
|
|
591
|
+
- Only tested with React 18+ and Vue 3.3+
|
|
592
|
+
|
|
593
|
+
Found a bug? Have feedback? [Open an issue](https://github.com/simulieren/adonisjs-server-stats/issues) — it helps a lot.
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
426
597
|
## Dev Toolbar
|
|
427
598
|
|
|
428
599
|
Adds a debug panel with SQL query inspection, event tracking, email capture with HTML preview, route table, live logs, and per-request tracing. Only active in non-production environments.
|
|
429
600
|
|
|
601
|
+
```ts
|
|
602
|
+
export default defineConfig({
|
|
603
|
+
toolbar: {
|
|
604
|
+
slowQueryThreshold: 100,
|
|
605
|
+
tracing: true,
|
|
606
|
+
persist: true,
|
|
607
|
+
},
|
|
608
|
+
})
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
Debug routes are auto-registered by the package at `/admin/api/debug/*` (configurable via `advanced.debugEndpoint`).
|
|
612
|
+
|
|
613
|
+
<details>
|
|
614
|
+
<summary>Legacy format (deprecated)</summary>
|
|
615
|
+
|
|
430
616
|
```ts
|
|
431
617
|
export default defineConfig({
|
|
432
618
|
devToolbar: {
|
|
@@ -435,13 +621,13 @@ export default defineConfig({
|
|
|
435
621
|
maxEvents: 200,
|
|
436
622
|
maxEmails: 100,
|
|
437
623
|
slowQueryThresholdMs: 100,
|
|
438
|
-
persistDebugData: true,
|
|
439
|
-
tracing: true,
|
|
624
|
+
persistDebugData: true,
|
|
625
|
+
tracing: true,
|
|
440
626
|
},
|
|
441
627
|
})
|
|
442
628
|
```
|
|
443
629
|
|
|
444
|
-
|
|
630
|
+
</details>
|
|
445
631
|
|
|
446
632
|
### Built-in Emails Tab
|
|
447
633
|
|
|
@@ -459,7 +645,7 @@ The debug toolbar captures all emails sent via AdonisJS mail (`mail:sending`, `m
|
|
|
459
645
|
|
|
460
646
|
### Persistent Debug Data
|
|
461
647
|
|
|
462
|
-
Enable `persistDebugData: true` to save queries, events, and emails to `.adonisjs/server-stats/debug-data.json`. You can
|
|
648
|
+
Enable `toolbar.persist: true` (or the legacy `devToolbar.persistDebugData: true`) to save queries, events, and emails to `.adonisjs/server-stats/debug-data.json`. You can customize the path via `advanced.persistPath`. Data is:
|
|
463
649
|
|
|
464
650
|
- **Loaded** on server startup (before collectors start)
|
|
465
651
|
- **Flushed** every 30 seconds (handles crashes)
|
|
@@ -530,37 +716,28 @@ If `better-sqlite3` is not installed, the dashboard will log a helpful message a
|
|
|
530
716
|
```ts
|
|
531
717
|
// config/server_stats.ts
|
|
532
718
|
export default defineConfig({
|
|
533
|
-
|
|
534
|
-
enabled: true,
|
|
535
|
-
dashboard: true,
|
|
536
|
-
},
|
|
719
|
+
dashboard: true,
|
|
537
720
|
})
|
|
538
721
|
```
|
|
539
722
|
|
|
540
|
-
Restart your dev server and visit **`/__stats`** (or your configured `
|
|
723
|
+
Restart your dev server and visit **`/__stats`** (or your configured `dashboard.path`).
|
|
541
724
|
|
|
542
725
|
#### Configuration
|
|
543
726
|
|
|
544
727
|
```ts
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
// URL prefixes to exclude from tracing and dashboard persistence (default: [])
|
|
559
|
-
excludeFromTracing: ['/admin/api/debug'],
|
|
560
|
-
|
|
561
|
-
// Enable tracing for per-request timeline in the dashboard (recommended)
|
|
562
|
-
tracing: true,
|
|
563
|
-
}
|
|
728
|
+
export default defineConfig({
|
|
729
|
+
dashboard: {
|
|
730
|
+
path: '/__stats',
|
|
731
|
+
retentionDays: 7,
|
|
732
|
+
},
|
|
733
|
+
toolbar: {
|
|
734
|
+
tracing: true,
|
|
735
|
+
excludeFromTracing: ['/admin/api/debug'],
|
|
736
|
+
},
|
|
737
|
+
advanced: {
|
|
738
|
+
dbPath: '.adonisjs/server-stats/dashboard.sqlite3',
|
|
739
|
+
},
|
|
740
|
+
})
|
|
564
741
|
```
|
|
565
742
|
|
|
566
743
|
#### Dashboard Sections
|
|
@@ -581,15 +758,12 @@ devToolbar: {
|
|
|
581
758
|
|
|
582
759
|
#### Access Control
|
|
583
760
|
|
|
584
|
-
The dashboard reuses the `
|
|
761
|
+
The dashboard reuses the `authorize` callback from the main config. If set, all dashboard routes are gated by it -- unauthorized requests receive a 403.
|
|
585
762
|
|
|
586
763
|
```ts
|
|
587
764
|
export default defineConfig({
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
enabled: true,
|
|
591
|
-
dashboard: true,
|
|
592
|
-
},
|
|
765
|
+
authorize: (ctx) => ctx.auth?.user?.role === 'admin',
|
|
766
|
+
dashboard: true,
|
|
593
767
|
})
|
|
594
768
|
```
|
|
595
769
|
|
|
@@ -613,7 +787,7 @@ The dashboard uses a dedicated SQLite database (separate from your app's databas
|
|
|
613
787
|
- **Self-cleaning** -- old data is automatically purged based on `retentionDays`
|
|
614
788
|
- **WAL mode** -- concurrent reads don't block writes
|
|
615
789
|
|
|
616
|
-
The SQLite file is created at the configured `dbPath` (default: `.adonisjs/server-stats/dashboard.sqlite3`). Add it to your `.gitignore`:
|
|
790
|
+
The SQLite file is created at the configured `advanced.dbPath` (default: `.adonisjs/server-stats/dashboard.sqlite3`). Add it to your `.gitignore`:
|
|
617
791
|
|
|
618
792
|
```
|
|
619
793
|
.adonisjs/server-stats/
|
|
@@ -661,8 +835,7 @@ const webhooksPane: DebugPane = {
|
|
|
661
835
|
}
|
|
662
836
|
|
|
663
837
|
export default defineConfig({
|
|
664
|
-
|
|
665
|
-
enabled: true,
|
|
838
|
+
toolbar: {
|
|
666
839
|
panes: [webhooksPane],
|
|
667
840
|
},
|
|
668
841
|
})
|
|
@@ -773,10 +946,14 @@ All types are exported for consumer use:
|
|
|
773
946
|
import type {
|
|
774
947
|
ServerStats,
|
|
775
948
|
ServerStatsConfig,
|
|
949
|
+
ResolvedServerStatsConfig,
|
|
776
950
|
MetricCollector,
|
|
777
951
|
MetricValue,
|
|
778
952
|
LogStats,
|
|
779
953
|
DevToolbarOptions,
|
|
954
|
+
ToolbarConfig,
|
|
955
|
+
DashboardConfig,
|
|
956
|
+
AdvancedConfig,
|
|
780
957
|
} from 'adonisjs-server-stats'
|
|
781
958
|
|
|
782
959
|
// Debug types
|
|
@@ -827,16 +1004,19 @@ import type {
|
|
|
827
1004
|
|
|
828
1005
|
All integrations use lazy `import()` -- missing peer deps won't crash the app. The corresponding collector simply returns defaults.
|
|
829
1006
|
|
|
830
|
-
| Dependency | Required By
|
|
831
|
-
| --------------------------- |
|
|
832
|
-
| `@adonisjs/core` | Everything (required)
|
|
833
|
-
| `@adonisjs/lucid` | `dbPoolCollector`, `appCollector`, dashboard
|
|
834
|
-
| `@adonisjs/redis` | `redisCollector`, dashboard cache inspector
|
|
835
|
-
| `@adonisjs/transmit` | Provider (SSE broadcast), dashboard real-time
|
|
836
|
-
| `@
|
|
837
|
-
| `
|
|
838
|
-
| `
|
|
839
|
-
| `
|
|
1007
|
+
| Dependency | Required By |
|
|
1008
|
+
| --------------------------- | --------------------------------------------------- |
|
|
1009
|
+
| `@adonisjs/core` | Everything (required) |
|
|
1010
|
+
| `@adonisjs/lucid` | `dbPoolCollector`, `appCollector`, dashboard |
|
|
1011
|
+
| `@adonisjs/redis` | `redisCollector`, dashboard cache inspector |
|
|
1012
|
+
| `@adonisjs/transmit` | Provider (SSE broadcast), dashboard real-time |
|
|
1013
|
+
| `@adonisjs/transmit-client` | React/Vue real-time updates (falls back to polling) |
|
|
1014
|
+
| `@julr/adonisjs-prometheus` | `serverStatsCollector` |
|
|
1015
|
+
| `bullmq` | `queueCollector` |
|
|
1016
|
+
| `better-sqlite3` | Dashboard (`dashboard: true`) |
|
|
1017
|
+
| `edge.js` | Edge tag |
|
|
1018
|
+
| `react`, `react-dom` | React components (alpha) |
|
|
1019
|
+
| `vue` | Vue components (alpha) |
|
|
840
1020
|
|
|
841
1021
|
## License
|
|
842
1022
|
|