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.
Files changed (527) hide show
  1. package/README.md +351 -171
  2. package/dist/configure.d.ts.map +1 -1
  3. package/dist/core/api-client.d.ts +73 -0
  4. package/dist/core/api-client.d.ts.map +1 -0
  5. package/dist/core/config-utils.d.ts +109 -0
  6. package/dist/core/config-utils.d.ts.map +1 -0
  7. package/dist/core/constants.d.ts +11 -0
  8. package/dist/core/constants.d.ts.map +1 -0
  9. package/dist/core/dashboard-api.d.ts +65 -0
  10. package/dist/core/dashboard-api.d.ts.map +1 -0
  11. package/dist/core/dashboard-data-controller.d.ts +157 -0
  12. package/dist/core/dashboard-data-controller.d.ts.map +1 -0
  13. package/dist/core/debug-data-controller.d.ts +89 -0
  14. package/dist/core/debug-data-controller.d.ts.map +1 -0
  15. package/dist/core/feature-detect.d.ts +67 -0
  16. package/dist/core/feature-detect.d.ts.map +1 -0
  17. package/dist/core/formatters.d.ts +189 -0
  18. package/dist/core/formatters.d.ts.map +1 -0
  19. package/dist/core/history-buffer.d.ts +23 -0
  20. package/dist/core/history-buffer.d.ts.map +1 -0
  21. package/dist/core/icons.d.ts +36 -0
  22. package/dist/core/icons.d.ts.map +1 -0
  23. package/dist/core/index.d.ts +39 -0
  24. package/dist/core/index.d.ts.map +1 -0
  25. package/dist/core/index.js +1961 -0
  26. package/dist/core/internals-utils.d.ts +71 -0
  27. package/dist/core/internals-utils.d.ts.map +1 -0
  28. package/dist/core/job-utils.d.ts +45 -0
  29. package/dist/core/job-utils.d.ts.map +1 -0
  30. package/dist/core/log-utils.d.ts +34 -0
  31. package/dist/core/log-utils.d.ts.map +1 -0
  32. package/dist/core/metrics.d.ts +41 -0
  33. package/dist/core/metrics.d.ts.map +1 -0
  34. package/dist/core/pagination.d.ts +128 -0
  35. package/dist/core/pagination.d.ts.map +1 -0
  36. package/dist/core/query-utils.d.ts +35 -0
  37. package/dist/core/query-utils.d.ts.map +1 -0
  38. package/dist/core/resizable-columns.d.ts +18 -0
  39. package/dist/core/resizable-columns.d.ts.map +1 -0
  40. package/dist/core/routes.d.ts +12 -0
  41. package/dist/core/routes.d.ts.map +1 -0
  42. package/dist/core/server-stats-controller.d.ts +106 -0
  43. package/dist/core/server-stats-controller.d.ts.map +1 -0
  44. package/dist/core/sparkline.d.ts +80 -0
  45. package/dist/core/sparkline.d.ts.map +1 -0
  46. package/dist/core/theme.d.ts +42 -0
  47. package/dist/core/theme.d.ts.map +1 -0
  48. package/dist/core/trace-utils.d.ts +62 -0
  49. package/dist/core/trace-utils.d.ts.map +1 -0
  50. package/dist/core/transmit-adapter.d.ts +59 -0
  51. package/dist/core/transmit-adapter.d.ts.map +1 -0
  52. package/dist/core/types.d.ts +619 -0
  53. package/dist/core/types.d.ts.map +1 -0
  54. package/dist/react/CacheSection-DGxMDlWK.js +146 -0
  55. package/dist/react/CacheTab-CnVW5PLs.js +123 -0
  56. package/dist/react/ConfigContent-CnsEI4j3.js +397 -0
  57. package/dist/react/ConfigSection-DPcrfqXY.js +11 -0
  58. package/dist/react/ConfigTab-BSWq_o2p.js +15 -0
  59. package/dist/react/CustomPaneTab-xjkYwTvH.js +104 -0
  60. package/dist/react/DataTable-YyShr5B-.js +55 -0
  61. package/dist/react/EmailsSection-CSyTg1aX.js +262 -0
  62. package/dist/react/EmailsTab-Dh2YSa_f.js +131 -0
  63. package/dist/react/EventsSection-C1pbJDfW.js +86 -0
  64. package/dist/react/EventsTab-eCh02cdd.js +63 -0
  65. package/dist/react/FilterBar-DQRXpWrb.js +50 -0
  66. package/dist/react/InternalsContent-DBzsI0CG.js +346 -0
  67. package/dist/react/InternalsSection-t7ihcWO-.js +32 -0
  68. package/dist/react/InternalsTab-Oij0A2fN.js +30 -0
  69. package/dist/react/JobsSection-CLAin5vU.js +187 -0
  70. package/dist/react/JobsTab-Dl5nrj2z.js +141 -0
  71. package/dist/react/LogsSection-C1p81fXO.js +212 -0
  72. package/dist/react/LogsTab-D-kR7PjX.js +88 -0
  73. package/dist/react/OverviewSection-nm3xdACz.js +539 -0
  74. package/dist/react/Pagination-BkmzUDY8.js +64 -0
  75. package/dist/react/QueriesSection-DB12HMfQ.js +461 -0
  76. package/dist/react/QueriesTab-fyBB1u_Y.js +90 -0
  77. package/dist/react/RequestsSection-DTqB81ac.js +209 -0
  78. package/dist/react/RoutesSection-DJWa4NPV.js +74 -0
  79. package/dist/react/RoutesTab-D3l8TOpu.js +74 -0
  80. package/dist/react/TimelineSection-C4d-jRX1.js +158 -0
  81. package/dist/react/TimelineTab-C5TFaSmQ.js +193 -0
  82. package/dist/react/WaterfallChart-Cj73WdfM.js +100 -0
  83. package/dist/react/core/api-client.d.ts +73 -0
  84. package/dist/react/core/api-client.d.ts.map +1 -0
  85. package/dist/react/core/config-utils.d.ts +109 -0
  86. package/dist/react/core/config-utils.d.ts.map +1 -0
  87. package/dist/react/core/constants.d.ts +11 -0
  88. package/dist/react/core/constants.d.ts.map +1 -0
  89. package/dist/react/core/dashboard-api.d.ts +65 -0
  90. package/dist/react/core/dashboard-api.d.ts.map +1 -0
  91. package/dist/react/core/dashboard-data-controller.d.ts +157 -0
  92. package/dist/react/core/dashboard-data-controller.d.ts.map +1 -0
  93. package/dist/react/core/debug-data-controller.d.ts +89 -0
  94. package/dist/react/core/debug-data-controller.d.ts.map +1 -0
  95. package/dist/react/core/feature-detect.d.ts +67 -0
  96. package/dist/react/core/feature-detect.d.ts.map +1 -0
  97. package/dist/react/core/formatters.d.ts +189 -0
  98. package/dist/react/core/formatters.d.ts.map +1 -0
  99. package/dist/react/core/history-buffer.d.ts +23 -0
  100. package/dist/react/core/history-buffer.d.ts.map +1 -0
  101. package/dist/react/core/icons.d.ts +36 -0
  102. package/dist/react/core/icons.d.ts.map +1 -0
  103. package/dist/react/core/index.d.ts +39 -0
  104. package/dist/react/core/index.d.ts.map +1 -0
  105. package/dist/react/core/internals-utils.d.ts +71 -0
  106. package/dist/react/core/internals-utils.d.ts.map +1 -0
  107. package/dist/react/core/job-utils.d.ts +45 -0
  108. package/dist/react/core/job-utils.d.ts.map +1 -0
  109. package/dist/react/core/log-utils.d.ts +34 -0
  110. package/dist/react/core/log-utils.d.ts.map +1 -0
  111. package/dist/react/core/metrics.d.ts +41 -0
  112. package/dist/react/core/metrics.d.ts.map +1 -0
  113. package/dist/react/core/pagination.d.ts +128 -0
  114. package/dist/react/core/pagination.d.ts.map +1 -0
  115. package/dist/react/core/query-utils.d.ts +35 -0
  116. package/dist/react/core/query-utils.d.ts.map +1 -0
  117. package/dist/react/core/resizable-columns.d.ts +18 -0
  118. package/dist/react/core/resizable-columns.d.ts.map +1 -0
  119. package/dist/react/core/routes.d.ts +12 -0
  120. package/dist/react/core/routes.d.ts.map +1 -0
  121. package/dist/react/core/server-stats-controller.d.ts +106 -0
  122. package/dist/react/core/server-stats-controller.d.ts.map +1 -0
  123. package/dist/react/core/sparkline.d.ts +80 -0
  124. package/dist/react/core/sparkline.d.ts.map +1 -0
  125. package/dist/react/core/theme.d.ts +42 -0
  126. package/dist/react/core/theme.d.ts.map +1 -0
  127. package/dist/react/core/trace-utils.d.ts +62 -0
  128. package/dist/react/core/trace-utils.d.ts.map +1 -0
  129. package/dist/react/core/transmit-adapter.d.ts +59 -0
  130. package/dist/react/core/transmit-adapter.d.ts.map +1 -0
  131. package/dist/react/core/types.d.ts +619 -0
  132. package/dist/react/core/types.d.ts.map +1 -0
  133. package/dist/react/index-UdTfSvtO.js +1074 -0
  134. package/dist/react/index.js +18 -0
  135. package/dist/react/react/components/Dashboard/DashboardPage.d.ts +17 -0
  136. package/dist/react/react/components/Dashboard/DashboardPage.d.ts.map +1 -0
  137. package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts +7 -0
  138. package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts.map +1 -0
  139. package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts +7 -0
  140. package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts.map +1 -0
  141. package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts +7 -0
  142. package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts.map +1 -0
  143. package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts +7 -0
  144. package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts.map +1 -0
  145. package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts +14 -0
  146. package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts.map +1 -0
  147. package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts +7 -0
  148. package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts.map +1 -0
  149. package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts +7 -0
  150. package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts.map +1 -0
  151. package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts +7 -0
  152. package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts.map +1 -0
  153. package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts +7 -0
  154. package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts.map +1 -0
  155. package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts +7 -0
  156. package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts.map +1 -0
  157. package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts +7 -0
  158. package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts.map +1 -0
  159. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +9 -0
  160. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts.map +1 -0
  161. package/dist/react/react/components/Dashboard/shared/DataTable.d.ts +27 -0
  162. package/dist/react/react/components/Dashboard/shared/DataTable.d.ts.map +1 -0
  163. package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts +17 -0
  164. package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts.map +1 -0
  165. package/dist/react/react/components/Dashboard/shared/Pagination.d.ts +13 -0
  166. package/dist/react/react/components/Dashboard/shared/Pagination.d.ts.map +1 -0
  167. package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts +12 -0
  168. package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts.map +1 -0
  169. package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts +16 -0
  170. package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts.map +1 -0
  171. package/dist/react/react/components/DebugPanel/DebugPanel.d.ts +16 -0
  172. package/dist/react/react/components/DebugPanel/DebugPanel.d.ts.map +1 -0
  173. package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts +8 -0
  174. package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts.map +1 -0
  175. package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts +8 -0
  176. package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts.map +1 -0
  177. package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts +14 -0
  178. package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts.map +1 -0
  179. package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts +7 -0
  180. package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts.map +1 -0
  181. package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts +7 -0
  182. package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts.map +1 -0
  183. package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts +12 -0
  184. package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts.map +1 -0
  185. package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts +9 -0
  186. package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts.map +1 -0
  187. package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts +7 -0
  188. package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts.map +1 -0
  189. package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts +7 -0
  190. package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts.map +1 -0
  191. package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts +8 -0
  192. package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts.map +1 -0
  193. package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts +7 -0
  194. package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts.map +1 -0
  195. package/dist/react/react/components/StatsBar/MetricCard.d.ts +21 -0
  196. package/dist/react/react/components/StatsBar/MetricCard.d.ts.map +1 -0
  197. package/dist/react/react/components/StatsBar/Sparkline.d.ts +15 -0
  198. package/dist/react/react/components/StatsBar/Sparkline.d.ts.map +1 -0
  199. package/dist/react/react/components/StatsBar/StatsBar.d.ts +22 -0
  200. package/dist/react/react/components/StatsBar/StatsBar.d.ts.map +1 -0
  201. package/dist/react/react/components/shared/Badge.d.ts +32 -0
  202. package/dist/react/react/components/shared/Badge.d.ts.map +1 -0
  203. package/dist/react/react/components/shared/ConfigContent.d.ts +13 -0
  204. package/dist/react/react/components/shared/ConfigContent.d.ts.map +1 -0
  205. package/dist/react/react/components/shared/InternalsContent.d.ts +10 -0
  206. package/dist/react/react/components/shared/InternalsContent.d.ts.map +1 -0
  207. package/dist/react/react/components/shared/JsonViewer.d.ts +12 -0
  208. package/dist/react/react/components/shared/JsonViewer.d.ts.map +1 -0
  209. package/dist/react/react/components/shared/ThemeToggle.d.ts +13 -0
  210. package/dist/react/react/components/shared/ThemeToggle.d.ts.map +1 -0
  211. package/dist/react/react/components/shared/Tooltip.d.ts +16 -0
  212. package/dist/react/react/components/shared/Tooltip.d.ts.map +1 -0
  213. package/dist/react/react/hooks/useApiClient.d.ts +10 -0
  214. package/dist/react/react/hooks/useApiClient.d.ts.map +1 -0
  215. package/dist/react/react/hooks/useDashboardApiBase.d.ts +19 -0
  216. package/dist/react/react/hooks/useDashboardApiBase.d.ts.map +1 -0
  217. package/dist/react/react/hooks/useDashboardData.d.ts +27 -0
  218. package/dist/react/react/hooks/useDashboardData.d.ts.map +1 -0
  219. package/dist/react/react/hooks/useDebugData.d.ts +17 -0
  220. package/dist/react/react/hooks/useDebugData.d.ts.map +1 -0
  221. package/dist/react/react/hooks/useFeatures.d.ts +13 -0
  222. package/dist/react/react/hooks/useFeatures.d.ts.map +1 -0
  223. package/dist/react/react/hooks/useResizableTable.d.ts +13 -0
  224. package/dist/react/react/hooks/useResizableTable.d.ts.map +1 -0
  225. package/dist/react/react/hooks/useServerStats.d.ts +21 -0
  226. package/dist/react/react/hooks/useServerStats.d.ts.map +1 -0
  227. package/dist/react/react/hooks/useTheme.d.ts +12 -0
  228. package/dist/react/react/hooks/useTheme.d.ts.map +1 -0
  229. package/dist/react/react/index.d.ts +14 -0
  230. package/dist/react/react/index.d.ts.map +1 -0
  231. package/dist/react/style.css +1 -0
  232. package/dist/react/useApiClient-BVtNCmnL.js +9 -0
  233. package/dist/react/useDashboardApiBase-Bi36pJ2L.js +14 -0
  234. package/dist/react/useResizableTable-CNJmACdt.js +13 -0
  235. package/dist/src/collectors/app_collector.d.ts.map +1 -1
  236. package/dist/src/collectors/app_collector.js +30 -2
  237. package/dist/src/collectors/auto_detect.d.ts +31 -0
  238. package/dist/src/collectors/auto_detect.d.ts.map +1 -0
  239. package/dist/src/collectors/auto_detect.js +120 -0
  240. package/dist/src/collectors/collector.d.ts +17 -0
  241. package/dist/src/collectors/collector.d.ts.map +1 -1
  242. package/dist/src/collectors/db_pool_collector.d.ts.map +1 -1
  243. package/dist/src/collectors/db_pool_collector.js +35 -1
  244. package/dist/src/collectors/http_collector.d.ts +4 -3
  245. package/dist/src/collectors/http_collector.d.ts.map +1 -1
  246. package/dist/src/collectors/http_collector.js +28 -11
  247. package/dist/src/collectors/index.d.ts +2 -0
  248. package/dist/src/collectors/index.d.ts.map +1 -1
  249. package/dist/src/collectors/index.js +1 -0
  250. package/dist/src/collectors/log_collector.d.ts +11 -4
  251. package/dist/src/collectors/log_collector.d.ts.map +1 -1
  252. package/dist/src/collectors/log_collector.js +51 -5
  253. package/dist/src/collectors/process_collector.d.ts.map +1 -1
  254. package/dist/src/collectors/process_collector.js +4 -0
  255. package/dist/src/collectors/queue_collector.d.ts.map +1 -1
  256. package/dist/src/collectors/queue_collector.js +55 -1
  257. package/dist/src/collectors/redis_collector.d.ts.map +1 -1
  258. package/dist/src/collectors/redis_collector.js +42 -3
  259. package/dist/src/collectors/system_collector.d.ts.map +1 -1
  260. package/dist/src/collectors/system_collector.js +4 -0
  261. package/dist/src/controller/api_controller.d.ts +101 -0
  262. package/dist/src/controller/api_controller.d.ts.map +1 -0
  263. package/dist/src/controller/api_controller.js +131 -0
  264. package/dist/src/controller/debug_controller.d.ts +19 -10
  265. package/dist/src/controller/debug_controller.d.ts.map +1 -1
  266. package/dist/src/controller/debug_controller.js +118 -101
  267. package/dist/src/core/theme.d.ts +42 -0
  268. package/dist/src/core/theme.d.ts.map +1 -0
  269. package/dist/src/core/theme.js +115 -0
  270. package/dist/src/dashboard/chart_aggregator.d.ts.map +1 -1
  271. package/dist/src/dashboard/chart_aggregator.js +3 -2
  272. package/dist/src/dashboard/dashboard_controller.d.ts +10 -14
  273. package/dist/src/dashboard/dashboard_controller.d.ts.map +1 -1
  274. package/dist/src/dashboard/dashboard_controller.js +132 -250
  275. package/dist/src/dashboard/dashboard_store.d.ts +62 -19
  276. package/dist/src/dashboard/dashboard_store.d.ts.map +1 -1
  277. package/dist/src/dashboard/dashboard_store.js +242 -53
  278. package/dist/src/dashboard/integrations/cache_inspector.d.ts +19 -1
  279. package/dist/src/dashboard/integrations/cache_inspector.d.ts.map +1 -1
  280. package/dist/src/dashboard/integrations/config_inspector.d.ts +1 -1
  281. package/dist/src/dashboard/integrations/config_inspector.d.ts.map +1 -1
  282. package/dist/src/dashboard/integrations/config_inspector.js +3 -2
  283. package/dist/src/dashboard/integrations/queue_inspector.d.ts +55 -10
  284. package/dist/src/dashboard/integrations/queue_inspector.d.ts.map +1 -1
  285. package/dist/src/dashboard/integrations/queue_inspector.js +70 -24
  286. package/dist/src/dashboard/migrator.d.ts +5 -0
  287. package/dist/src/dashboard/migrator.d.ts.map +1 -1
  288. package/dist/src/dashboard/migrator.js +44 -9
  289. package/dist/src/dashboard/models/stats_event.d.ts +1 -1
  290. package/dist/src/dashboard/models/stats_event.d.ts.map +1 -1
  291. package/dist/src/dashboard/models/stats_log.d.ts +1 -1
  292. package/dist/src/dashboard/models/stats_log.d.ts.map +1 -1
  293. package/dist/src/dashboard/models/stats_query.d.ts +1 -1
  294. package/dist/src/dashboard/models/stats_query.d.ts.map +1 -1
  295. package/dist/src/dashboard/models/stats_saved_filter.d.ts +1 -1
  296. package/dist/src/dashboard/models/stats_saved_filter.d.ts.map +1 -1
  297. package/dist/src/dashboard/models/stats_trace.d.ts +2 -1
  298. package/dist/src/dashboard/models/stats_trace.d.ts.map +1 -1
  299. package/dist/src/data/data_access.d.ts +105 -0
  300. package/dist/src/data/data_access.d.ts.map +1 -0
  301. package/dist/src/data/data_access.js +310 -0
  302. package/dist/src/data/index.d.ts +3 -0
  303. package/dist/src/data/index.d.ts.map +1 -0
  304. package/dist/src/data/index.js +1 -0
  305. package/dist/src/debug/debug_store.d.ts +20 -1
  306. package/dist/src/debug/debug_store.d.ts.map +1 -1
  307. package/dist/src/debug/debug_store.js +43 -15
  308. package/dist/src/debug/email_collector.d.ts +6 -2
  309. package/dist/src/debug/email_collector.d.ts.map +1 -1
  310. package/dist/src/debug/email_collector.js +3 -0
  311. package/dist/src/debug/event_collector.d.ts +6 -2
  312. package/dist/src/debug/event_collector.d.ts.map +1 -1
  313. package/dist/src/debug/event_collector.js +12 -8
  314. package/dist/src/debug/query_collector.d.ts +6 -2
  315. package/dist/src/debug/query_collector.d.ts.map +1 -1
  316. package/dist/src/debug/query_collector.js +3 -0
  317. package/dist/src/debug/ring_buffer.d.ts +1 -0
  318. package/dist/src/debug/ring_buffer.d.ts.map +1 -1
  319. package/dist/src/debug/ring_buffer.js +5 -2
  320. package/dist/src/debug/route_inspector.d.ts +2 -2
  321. package/dist/src/debug/route_inspector.d.ts.map +1 -1
  322. package/dist/src/debug/route_inspector.js +4 -3
  323. package/dist/src/debug/trace_collector.d.ts +7 -3
  324. package/dist/src/debug/trace_collector.d.ts.map +1 -1
  325. package/dist/src/debug/trace_collector.js +7 -5
  326. package/dist/src/debug/types.d.ts +107 -2
  327. package/dist/src/debug/types.d.ts.map +1 -1
  328. package/dist/src/debug/types.js +1 -1
  329. package/dist/src/define_config.d.ts +49 -5
  330. package/dist/src/define_config.d.ts.map +1 -1
  331. package/dist/src/define_config.js +361 -4
  332. package/dist/src/edge/bootstrap.d.ts +17 -0
  333. package/dist/src/edge/bootstrap.d.ts.map +1 -0
  334. package/dist/src/edge/bootstrap.js +29 -0
  335. package/dist/src/edge/client/dashboard.js +2 -3619
  336. package/dist/src/edge/client/debug-panel-deferred.js +1 -0
  337. package/dist/src/edge/client/debug-panel.js +1 -2140
  338. package/dist/src/edge/client/stats-bar.js +1 -801
  339. package/dist/src/edge/client-vue/dashboard.js +5 -0
  340. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -0
  341. package/dist/src/edge/client-vue/debug-panel.js +4 -0
  342. package/dist/src/edge/client-vue/stats-bar.js +4 -0
  343. package/dist/src/edge/plugin.d.ts +35 -2
  344. package/dist/src/edge/plugin.d.ts.map +1 -1
  345. package/dist/src/edge/plugin.js +30 -66
  346. package/dist/src/edge/types.d.ts +46 -0
  347. package/dist/src/edge/types.d.ts.map +1 -0
  348. package/dist/src/edge/types.js +4 -0
  349. package/dist/src/edge/views/dashboard.edge +1 -358
  350. package/dist/src/edge/views/debug-panel.edge +2 -154
  351. package/dist/src/edge/views/stats-bar.edge +15 -48
  352. package/dist/src/engine/stats_engine.d.ts +18 -0
  353. package/dist/src/engine/stats_engine.d.ts.map +1 -1
  354. package/dist/src/engine/stats_engine.js +45 -2
  355. package/dist/src/index.d.ts +1 -1
  356. package/dist/src/index.d.ts.map +1 -1
  357. package/dist/src/log_stream/log_stream_provider.d.ts.map +1 -1
  358. package/dist/src/log_stream/log_stream_provider.js +21 -4
  359. package/dist/src/log_stream/log_stream_service.d.ts +8 -1
  360. package/dist/src/log_stream/log_stream_service.d.ts.map +1 -1
  361. package/dist/src/log_stream/log_stream_service.js +27 -3
  362. package/dist/src/middleware/request_tracking_middleware.d.ts +1 -1
  363. package/dist/src/middleware/request_tracking_middleware.d.ts.map +1 -1
  364. package/dist/src/middleware/request_tracking_middleware.js +21 -6
  365. package/dist/src/prometheus/prometheus_collector.d.ts +2 -1
  366. package/dist/src/prometheus/prometheus_collector.d.ts.map +1 -1
  367. package/dist/src/provider/server_stats_provider.d.ts +100 -0
  368. package/dist/src/provider/server_stats_provider.d.ts.map +1 -1
  369. package/dist/src/provider/server_stats_provider.js +460 -104
  370. package/dist/src/routes/access_middleware.d.ts +2 -1
  371. package/dist/src/routes/access_middleware.d.ts.map +1 -1
  372. package/dist/src/routes/access_middleware.js +7 -1
  373. package/dist/src/routes/index.d.ts +4 -0
  374. package/dist/src/routes/index.d.ts.map +1 -0
  375. package/dist/src/routes/index.js +1 -0
  376. package/dist/src/routes/register_routes.d.ts +103 -0
  377. package/dist/src/routes/register_routes.d.ts.map +1 -0
  378. package/dist/src/routes/register_routes.js +356 -0
  379. package/dist/src/routes/router_types.d.ts +29 -0
  380. package/dist/src/routes/router_types.d.ts.map +1 -0
  381. package/dist/src/routes/router_types.js +1 -0
  382. package/dist/src/stubs/config.stub +12 -32
  383. package/dist/src/styles/components.css +1048 -0
  384. package/dist/src/{edge/client → styles}/dashboard.css +299 -736
  385. package/dist/src/{edge/client → styles}/debug-panel.css +117 -633
  386. package/dist/src/{edge/client → styles}/stats-bar.css +28 -10
  387. package/dist/src/styles/tokens.css +153 -0
  388. package/dist/src/styles/utilities.css +75 -0
  389. package/dist/src/types.d.ts +119 -16
  390. package/dist/src/types.d.ts.map +1 -1
  391. package/dist/src/utils/app_import.d.ts +23 -0
  392. package/dist/src/utils/app_import.d.ts.map +1 -0
  393. package/dist/src/utils/app_import.js +44 -0
  394. package/dist/src/utils/json_helpers.d.ts +2 -2
  395. package/dist/src/utils/json_helpers.d.ts.map +1 -1
  396. package/dist/src/utils/logger.d.ts +17 -0
  397. package/dist/src/utils/logger.d.ts.map +1 -0
  398. package/dist/src/utils/logger.js +27 -0
  399. package/dist/src/utils/mail_helpers.d.ts +1 -1
  400. package/dist/src/utils/mail_helpers.d.ts.map +1 -1
  401. package/dist/src/utils/mail_helpers.js +1 -1
  402. package/dist/vue/CacheSection-C788Yfai.js +149 -0
  403. package/dist/vue/CacheTab-BPisYYiQ.js +104 -0
  404. package/dist/vue/ConfigSection-CRzYxqW2.js +576 -0
  405. package/dist/vue/ConfigTab-C8cafGUj.js +361 -0
  406. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +172 -0
  407. package/dist/vue/EmailsSection-C8JFMtW7.js +206 -0
  408. package/dist/vue/EmailsTab-DhFhoNmU.js +157 -0
  409. package/dist/vue/EventsSection-C4wXUgxG.js +107 -0
  410. package/dist/vue/EventsTab-DQ4Nd6AK.js +97 -0
  411. package/dist/vue/FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js +62 -0
  412. package/dist/vue/InternalsSection-BJUXE-5F.js +468 -0
  413. package/dist/vue/InternalsTab-DEMjqtlw.js +471 -0
  414. package/dist/vue/JobsSection-CsKWTjgN.js +187 -0
  415. package/dist/vue/JobsTab-BCvhOARO.js +117 -0
  416. package/dist/vue/JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js +67 -0
  417. package/dist/vue/LogsSection-BFVjSZ24.js +227 -0
  418. package/dist/vue/LogsTab-DpEQ7euu.js +122 -0
  419. package/dist/vue/OverviewSection-CbMdAido.js +849 -0
  420. package/dist/vue/PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js +50 -0
  421. package/dist/vue/QueriesSection-BPiv7u3r.js +429 -0
  422. package/dist/vue/QueriesTab-C8_7oprC.js +107 -0
  423. package/dist/vue/RequestsSection-LtImH4rD.js +243 -0
  424. package/dist/vue/RoutesSection-CrxOxmzx.js +106 -0
  425. package/dist/vue/RoutesTab-Dz0MkZuF.js +80 -0
  426. package/dist/vue/TimelineSection-DLxMW2J_.js +186 -0
  427. package/dist/vue/TimelineTab-Db6lKKsD.js +250 -0
  428. package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +118 -0
  429. package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts +18 -0
  430. package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts.map +1 -0
  431. package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts +5 -0
  432. package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts.map +1 -0
  433. package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts +3 -0
  434. package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts.map +1 -0
  435. package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts +5 -0
  436. package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts.map +1 -0
  437. package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts +5 -0
  438. package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts.map +1 -0
  439. package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts +3 -0
  440. package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts.map +1 -0
  441. package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts +5 -0
  442. package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts.map +1 -0
  443. package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts +3 -0
  444. package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts.map +1 -0
  445. package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts +5 -0
  446. package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts.map +1 -0
  447. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +45 -0
  448. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts.map +1 -0
  449. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +5 -0
  450. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts.map +1 -0
  451. package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts +5 -0
  452. package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts.map +1 -0
  453. package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts +11 -0
  454. package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts.map +1 -0
  455. package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts +29 -0
  456. package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts.map +1 -0
  457. package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts +12 -0
  458. package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts.map +1 -0
  459. package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts +11 -0
  460. package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts.map +1 -0
  461. package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts +10 -0
  462. package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts.map +1 -0
  463. package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts +21 -0
  464. package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts.map +1 -0
  465. package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts +12 -0
  466. package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts.map +1 -0
  467. package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts +11 -0
  468. package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts.map +1 -0
  469. package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts +11 -0
  470. package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts.map +1 -0
  471. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +12 -0
  472. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts.map +1 -0
  473. package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts +12 -0
  474. package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts.map +1 -0
  475. package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts +11 -0
  476. package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts.map +1 -0
  477. package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts +13 -0
  478. package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts.map +1 -0
  479. package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts +15 -0
  480. package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts.map +1 -0
  481. package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts +12 -0
  482. package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts.map +1 -0
  483. package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts +12 -0
  484. package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts.map +1 -0
  485. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +15 -0
  486. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts.map +1 -0
  487. package/dist/vue/components/StatsBar/MetricCard.vue.d.ts +19 -0
  488. package/dist/vue/components/StatsBar/MetricCard.vue.d.ts.map +1 -0
  489. package/dist/vue/components/StatsBar/Sparkline.vue.d.ts +17 -0
  490. package/dist/vue/components/StatsBar/Sparkline.vue.d.ts.map +1 -0
  491. package/dist/vue/components/StatsBar/StatsBar.vue.d.ts +22 -0
  492. package/dist/vue/components/StatsBar/StatsBar.vue.d.ts.map +1 -0
  493. package/dist/vue/components/shared/JsonViewer.vue.d.ts +13 -0
  494. package/dist/vue/components/shared/JsonViewer.vue.d.ts.map +1 -0
  495. package/dist/vue/components/shared/ThemeToggle.vue.d.ts +8 -0
  496. package/dist/vue/components/shared/ThemeToggle.vue.d.ts.map +1 -0
  497. package/dist/vue/composables/useApiClient.d.ts +9 -0
  498. package/dist/vue/composables/useApiClient.d.ts.map +1 -0
  499. package/dist/vue/composables/useDashboardData.d.ts +53 -0
  500. package/dist/vue/composables/useDashboardData.d.ts.map +1 -0
  501. package/dist/vue/composables/useDebugData.d.ts +25 -0
  502. package/dist/vue/composables/useDebugData.d.ts.map +1 -0
  503. package/dist/vue/composables/useFeatures.d.ts +80 -0
  504. package/dist/vue/composables/useFeatures.d.ts.map +1 -0
  505. package/dist/vue/composables/useResizableTable.d.ts +16 -0
  506. package/dist/vue/composables/useResizableTable.d.ts.map +1 -0
  507. package/dist/vue/composables/useServerStats.d.ts +104 -0
  508. package/dist/vue/composables/useServerStats.d.ts.map +1 -0
  509. package/dist/vue/composables/useTheme.d.ts +6 -0
  510. package/dist/vue/composables/useTheme.d.ts.map +1 -0
  511. package/dist/vue/index-qCQpBftQ.js +1233 -0
  512. package/dist/vue/index.d.ts +10 -0
  513. package/dist/vue/index.d.ts.map +1 -0
  514. package/dist/vue/index.js +11 -0
  515. package/dist/vue/style.css +1 -0
  516. package/dist/vue/useApiClient-BQQ9CF-q.js +10 -0
  517. package/dist/vue/useResizableTable-BoivAevK.js +17 -0
  518. package/package.json +72 -10
  519. package/dist/src/dashboard/dashboard_routes.d.ts +0 -16
  520. package/dist/src/dashboard/dashboard_routes.d.ts.map +0 -1
  521. package/dist/src/dashboard/dashboard_routes.js +0 -77
  522. package/dist/src/routes/debug_routes.d.ts +0 -14
  523. package/dist/src/routes/debug_routes.d.ts.map +0 -1
  524. package/dist/src/routes/debug_routes.js +0 -42
  525. package/dist/src/routes/stats_routes.d.ts +0 -14
  526. package/dist/src/routes/stats_routes.d.ts.map +0 -1
  527. 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
  ![adonisjs-server-stats demo](https://raw.githubusercontent.com/simulieren/adonisjs-server-stats/main/screenshots/demo.gif)
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 React, no external assets
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
- import { processCollector, systemCollector, httpCollector } from 'adonisjs-server-stats/collectors'
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
- collectors: [processCollector(), systemCollector(), httpCollector()],
101
+ authorize: (ctx) => ctx.auth?.user?.role === 'admin',
102
+ toolbar: true,
103
+ dashboard: true,
89
104
  })
90
105
  ```
91
106
 
92
- That's it -- this gives you CPU, memory, event loop lag, and HTTP throughput out of the box. All other options have sensible defaults. Add more collectors as needed:
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
- // How often to collect and broadcast stats (in milliseconds)
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 `shouldShow` callback if configured (see [Visibility Control](#visibility-control-shouldshow)).
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
- | Option | Type | Default | Description |
185
- | ------------- | ---------------------- | --------------------------- | ------------------------------------ |
186
- | `intervalMs` | `number` | `3000` | Collection + broadcast interval (ms) |
187
- | `transport` | `'transmit' \| 'none'` | `'transmit'` | SSE transport. `'none'` = poll-only. |
188
- | `channelName` | `string` | `'admin/server-stats'` | Transmit channel name |
189
- | `endpoint` | `string \| false` | `'/admin/api/server-stats'` | HTTP endpoint. `false` to disable. |
190
- | `collectors` | `MetricCollector[]` | `[]` | Array of collector instances |
191
- | `skipInTest` | `boolean` | `true` | Skip collection during tests |
192
- | `onStats` | `(stats) => void` | -- | Callback after each collection tick |
193
- | `shouldShow` | `(ctx) => boolean` | -- | Per-request visibility guard |
194
- | `devToolbar` | `DevToolbarOptions` | -- | Dev toolbar configuration |
195
-
196
- ### `DevToolbarOptions`
197
-
198
- | Option | Type | Default | Description |
199
- | ---------------------- | ------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
200
- | `enabled` | `boolean` | `false` | Enable the dev toolbar |
201
- | `maxQueries` | `number` | `500` | Max SQL queries to buffer |
202
- | `maxEvents` | `number` | `200` | Max events to buffer |
203
- | `maxEmails` | `number` | `100` | Max emails to buffer |
204
- | `slowQueryThresholdMs` | `number` | `100` | Slow query threshold (ms) |
205
- | `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. |
206
- | `tracing` | `boolean` | `false` | Enable per-request tracing with timeline visualization |
207
- | `maxTraces` | `number` | `200` | Max request traces to buffer |
208
- | `dashboard` | `boolean` | `false` | Enable the full-page dashboard (requires `better-sqlite3`) |
209
- | `dashboardPath` | `string` | `'/__stats'` | URL path for the dashboard page |
210
- | `retentionDays` | `number` | `7` | Days to keep historical data in SQLite |
211
- | `dbPath` | `string` | `'.adonisjs/server-stats/dashboard.sqlite3'` | Path to the SQLite database file (relative to app root) |
212
- | `debugEndpoint` | `string` | `'/admin/api/debug'` | Base path for the debug toolbar API endpoints |
213
- | `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. |
214
- | `panes` | `DebugPane[]` | -- | Custom debug panel tabs |
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)` | Errors/warnings/entries (5m window), entries/minute | **required** | -- |
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
- logCollector({
257
- logPath: 'logs/adonisjs.log',
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 (`shouldShow`)
342
+ ## Visibility Control (`authorize`)
305
343
 
306
- Use `shouldShow` 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).
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 `shouldShow` runs **after** middleware (including auth), you have full access to `ctx.auth`.
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
- shouldShow: () => env.get('NODE_ENV'),
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
- shouldShow: (ctx) => ctx.auth?.user?.isAdmin === true,
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
- shouldShow: (ctx) => {
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 `shouldShow` is not set, the bar and all routes are accessible to everyone. In production you almost always want to set this.
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 `shouldShow` callback if configured.
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 `endpoint` is a string (default: `/admin/api/server-stats`). Returns the latest stats snapshot as JSON.
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 `devToolbar.enabled: true`. Base path configurable via `devToolbar.debugEndpoint` (default: `/admin/api/debug`).
388
+ Registered when `toolbar` is enabled. Base path configurable via `advanced.debugEndpoint` (default: `/admin/api/debug`).
349
389
 
350
- | Method | Path | Description |
351
- |--------|------|-------------|
352
- | GET | `/queries` | SQL queries with summary stats |
353
- | GET | `/events` | Application events |
354
- | GET | `/routes` | Registered route table |
355
- | GET | `/logs` | Log file entries (last 256KB) |
356
- | GET | `/emails` | Captured emails (stripped HTML) |
357
- | GET | `/emails/:id/preview` | Email HTML preview |
358
- | GET | `/traces` | Request traces |
359
- | GET | `/traces/:id` | Trace detail with spans |
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 `devToolbar.dashboard: true`. Base path configurable via `devToolbar.dashboardPath` (default: `/__stats`).
364
-
365
- | Method | Path | Description |
366
- |--------|------|-------------|
367
- | GET | `/` | Dashboard page (HTML) |
368
- | GET | `/api/overview` | Overview metrics |
369
- | GET | `/api/overview/chart` | Time-series chart data |
370
- | GET | `/api/requests` | Paginated request history |
371
- | GET | `/api/requests/:id` | Request detail with queries/trace |
372
- | GET | `/api/queries` | Paginated query list |
373
- | GET | `/api/queries/grouped` | Queries grouped by normalized SQL |
374
- | GET | `/api/queries/:id/explain` | EXPLAIN plan for a query |
375
- | GET | `/api/events` | Paginated event list |
376
- | GET | `/api/routes` | Route table |
377
- | GET | `/api/logs` | Paginated log entries |
378
- | GET | `/api/emails` | Paginated email list |
379
- | GET | `/api/emails/:id/preview` | Email HTML preview |
380
- | GET | `/api/traces` | Paginated trace list |
381
- | GET | `/api/traces/:id` | Trace detail with spans |
382
- | GET | `/api/cache` | Cache stats and key listing |
383
- | GET | `/api/cache/:key` | Cache key detail |
384
- | GET | `/api/jobs` | Job queue overview |
385
- | GET | `/api/jobs/:id` | Job detail |
386
- | POST | `/api/jobs/:id/retry` | Retry a failed job |
387
- | GET | `/api/config` | App config (secrets redacted) |
388
- | GET | `/api/filters` | Saved filters |
389
- | POST | `/api/filters` | Create saved filter |
390
- | DELETE | `/api/filters/:id` | Delete saved filter |
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 `shouldShow` callback for access control (recommended)
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, // or a custom path: 'custom/debug.json'
439
- tracing: true, // enable per-request timeline
624
+ persistDebugData: true,
625
+ tracing: true,
440
626
  },
441
627
  })
442
628
  ```
443
629
 
444
- Debug routes are auto-registered by the package at `/admin/api/debug/*` (configurable via `debugEndpoint`).
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 also pass a custom path (relative to app root) like `persistDebugData: 'custom/debug.json'`. Data is:
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
- devToolbar: {
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 `dashboardPath`).
723
+ Restart your dev server and visit **`/__stats`** (or your configured `dashboard.path`).
541
724
 
542
725
  #### Configuration
543
726
 
544
727
  ```ts
545
- devToolbar: {
546
- enabled: true,
547
- dashboard: true,
548
-
549
- // URL path for the dashboard (default: '/__stats')
550
- dashboardPath: '/__stats',
551
-
552
- // Days to retain historical data (default: 7)
553
- retentionDays: 7,
554
-
555
- // SQLite database file path, relative to app root (default: '.adonisjs/server-stats/dashboard.sqlite3')
556
- dbPath: '.adonisjs/server-stats/dashboard.sqlite3',
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 `shouldShow` callback from the main config. If set, all dashboard routes are gated by it -- unauthorized requests receive a 403.
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
- shouldShow: (ctx) => ctx.auth?.user?.role === 'admin',
589
- devToolbar: {
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
- devToolbar: {
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
- | `@julr/adonisjs-prometheus` | `serverStatsCollector` |
837
- | `bullmq` | `queueCollector` |
838
- | `better-sqlite3` | Dashboard (`dashboard: true`) |
839
- | `edge.js` | Edge tag |
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