adonisjs-server-stats 1.10.0 → 1.11.0

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 (248) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/field-resolvers.d.ts +64 -0
  10. package/dist/core/formatters-helpers.d.ts +23 -0
  11. package/dist/core/formatters.d.ts +15 -0
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.js +599 -509
  14. package/dist/core/log-utils-helpers.d.ts +13 -0
  15. package/dist/core/metrics.d.ts +3 -28
  16. package/dist/core/pagination.d.ts +0 -9
  17. package/dist/core/server-stats-controller.d.ts +6 -0
  18. package/dist/core/transmit-helpers.d.ts +7 -0
  19. package/dist/core/types-dashboard.d.ts +178 -0
  20. package/dist/core/types-diagnostics.d.ts +85 -0
  21. package/dist/core/types.d.ts +10 -442
  22. package/dist/react/CacheSection-BYN53kYO.js +135 -0
  23. package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
  24. package/dist/react/CacheTab-DOhuK05d.js +106 -0
  25. package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-B9EHh4Rp.js} +1 -1
  26. package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-C8kriE2b.js} +1 -1
  27. package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
  28. package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
  29. package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
  30. package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
  31. package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-DJPwHeT8.js} +28 -27
  32. package/dist/react/EventsTab-B-FoehXC.js +58 -0
  33. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  34. package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
  35. package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
  36. package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
  37. package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
  38. package/dist/react/JobsSection-DWF4i1t_.js +167 -0
  39. package/dist/react/JobsTab-DqnifQXV.js +129 -0
  40. package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
  41. package/dist/react/LogsSection-C1xC5aP4.js +198 -0
  42. package/dist/react/LogsTab-CS4sLfLw.js +79 -0
  43. package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-CxvfOR0v.js} +70 -80
  44. package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
  45. package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-x85PjkyS.js} +38 -40
  46. package/dist/react/RequestsSection-DETN9oZb.js +321 -0
  47. package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-CmorkJeC.js} +2 -2
  48. package/dist/react/RoutesTab-CbzBOzpc.js +68 -0
  49. package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
  50. package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
  51. package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-Ue9tUD_n.js} +76 -102
  52. package/dist/react/index-DwDK-4oX.js +1121 -0
  53. package/dist/react/index.js +6 -6
  54. package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
  55. package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
  56. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  57. package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
  58. package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
  59. package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
  60. package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
  61. package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
  62. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  63. package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
  64. package/dist/react/style.css +1 -1
  65. package/dist/src/collectors/app_collector.d.ts +0 -8
  66. package/dist/src/collectors/app_collector.js +45 -52
  67. package/dist/src/collectors/auto_detect.d.ts +0 -23
  68. package/dist/src/collectors/auto_detect.js +33 -55
  69. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  70. package/dist/src/collectors/db_pool_collector.js +72 -57
  71. package/dist/src/collectors/log_collector.d.ts +0 -47
  72. package/dist/src/collectors/log_collector.js +36 -65
  73. package/dist/src/collectors/queue_collector.d.ts +0 -20
  74. package/dist/src/collectors/queue_collector.js +60 -76
  75. package/dist/src/collectors/redis_collector.d.ts +10 -10
  76. package/dist/src/collectors/redis_collector.js +69 -66
  77. package/dist/src/config/deprecation_migration.d.ts +7 -0
  78. package/dist/src/config/deprecation_migration.js +201 -0
  79. package/dist/src/controller/debug_controller.d.ts +1 -1
  80. package/dist/src/controller/debug_controller.js +87 -81
  81. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  82. package/dist/src/dashboard/cache_handlers.js +52 -0
  83. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  84. package/dist/src/dashboard/chart_aggregator.js +68 -50
  85. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  86. package/dist/src/dashboard/coalesce_cache.js +47 -0
  87. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  88. package/dist/src/dashboard/dashboard_controller.js +51 -544
  89. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  90. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  91. package/dist/src/dashboard/dashboard_store.d.ts +19 -218
  92. package/dist/src/dashboard/dashboard_store.js +115 -1116
  93. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  94. package/dist/src/dashboard/dashboard_types.js +4 -0
  95. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  96. package/dist/src/dashboard/detail_queries.js +98 -0
  97. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  98. package/dist/src/dashboard/email_event_builder.js +65 -0
  99. package/dist/src/dashboard/explain_query.d.ts +8 -0
  100. package/dist/src/dashboard/explain_query.js +22 -0
  101. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  102. package/dist/src/dashboard/filter_handlers.js +56 -0
  103. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  104. package/dist/src/dashboard/filtered_queries.js +155 -0
  105. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  106. package/dist/src/dashboard/flush_manager.js +107 -0
  107. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  108. package/dist/src/dashboard/format_helpers.js +140 -0
  109. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  110. package/dist/src/dashboard/inspector_manager.js +102 -0
  111. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  112. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  113. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  114. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  115. package/dist/src/dashboard/jobs_handlers.js +61 -0
  116. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  117. package/dist/src/dashboard/knex_factory.js +91 -0
  118. package/dist/src/dashboard/migrator.js +30 -159
  119. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  120. package/dist/src/dashboard/migrator_tables.js +153 -0
  121. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  122. package/dist/src/dashboard/overview_queries.js +155 -0
  123. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  124. package/dist/src/dashboard/overview_query_runners.js +84 -0
  125. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  126. package/dist/src/dashboard/overview_store_queries.js +69 -0
  127. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  128. package/dist/src/dashboard/paginate_helper.js +33 -0
  129. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  130. package/dist/src/dashboard/query_explain_handler.js +80 -0
  131. package/dist/src/dashboard/read_queries.d.ts +32 -0
  132. package/dist/src/dashboard/read_queries.js +107 -0
  133. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  134. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  135. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  136. package/dist/src/dashboard/storage_stats.js +81 -0
  137. package/dist/src/dashboard/write_queue.d.ts +106 -0
  138. package/dist/src/dashboard/write_queue.js +225 -0
  139. package/dist/src/data/data_access.d.ts +2 -39
  140. package/dist/src/data/data_access.js +17 -193
  141. package/dist/src/data/data_access_helpers.d.ts +130 -0
  142. package/dist/src/data/data_access_helpers.js +212 -0
  143. package/dist/src/debug/debug_store.js +37 -32
  144. package/dist/src/debug/email_collector.d.ts +1 -10
  145. package/dist/src/debug/email_collector.js +78 -81
  146. package/dist/src/debug/event_collector.d.ts +0 -9
  147. package/dist/src/debug/event_collector.js +79 -62
  148. package/dist/src/debug/query_collector.js +23 -19
  149. package/dist/src/debug/route_inspector.d.ts +1 -5
  150. package/dist/src/debug/route_inspector.js +50 -51
  151. package/dist/src/debug/trace_collector.d.ts +9 -1
  152. package/dist/src/debug/trace_collector.js +21 -15
  153. package/dist/src/debug/types.d.ts +1 -1
  154. package/dist/src/define_config.d.ts +0 -65
  155. package/dist/src/define_config.js +93 -333
  156. package/dist/src/edge/client/dashboard.js +2 -2
  157. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  158. package/dist/src/edge/client/stats-bar.js +1 -1
  159. package/dist/src/edge/client-vue/dashboard.js +5 -5
  160. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
  161. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  162. package/dist/src/edge/plugin.d.ts +0 -16
  163. package/dist/src/edge/plugin.js +57 -64
  164. package/dist/src/engine/request_metrics.d.ts +1 -0
  165. package/dist/src/engine/request_metrics.js +32 -42
  166. package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
  167. package/dist/src/middleware/request_tracking_middleware.js +65 -93
  168. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  169. package/dist/src/provider/auth_middleware_detector.js +97 -0
  170. package/dist/src/provider/boot_helpers.d.ts +20 -0
  171. package/dist/src/provider/boot_helpers.js +91 -0
  172. package/dist/src/provider/boot_initializer.d.ts +28 -0
  173. package/dist/src/provider/boot_initializer.js +35 -0
  174. package/dist/src/provider/dashboard_init.d.ts +30 -0
  175. package/dist/src/provider/dashboard_init.js +138 -0
  176. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  177. package/dist/src/provider/dashboard_setup.js +78 -0
  178. package/dist/src/provider/diagnostics.d.ts +134 -0
  179. package/dist/src/provider/diagnostics.js +127 -0
  180. package/dist/src/provider/email_bridge.d.ts +43 -0
  181. package/dist/src/provider/email_bridge.js +80 -0
  182. package/dist/src/provider/email_helpers.d.ts +13 -0
  183. package/dist/src/provider/email_helpers.js +68 -0
  184. package/dist/src/provider/pino_hook.d.ts +17 -0
  185. package/dist/src/provider/pino_hook.js +35 -0
  186. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  187. package/dist/src/provider/provider_helpers_extra.js +177 -0
  188. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  189. package/dist/src/provider/server_stats_provider.js +132 -951
  190. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  191. package/dist/src/provider/shutdown_helpers.js +70 -0
  192. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  193. package/dist/src/provider/toolbar_setup.js +141 -0
  194. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  195. package/dist/src/routes/dashboard_routes.js +197 -0
  196. package/dist/src/routes/debug_routes.d.ts +14 -0
  197. package/dist/src/routes/debug_routes.js +101 -0
  198. package/dist/src/routes/register_routes.d.ts +0 -78
  199. package/dist/src/routes/register_routes.js +22 -352
  200. package/dist/src/routes/stats_routes.d.ts +5 -0
  201. package/dist/src/routes/stats_routes.js +14 -0
  202. package/dist/src/styles/components.css +163 -0
  203. package/dist/src/styles/dashboard.css +13 -105
  204. package/dist/src/styles/debug-panel.css +2 -53
  205. package/dist/src/styles/utilities.css +3 -1
  206. package/dist/src/types.d.ts +305 -14
  207. package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-DT2Mwf_s.js} +1 -1
  208. package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-BwKwS9lh.js} +1 -1
  209. package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
  210. package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-B65g0FVS.js} +1 -1
  211. package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-CxqtVF-o.js} +1 -1
  212. package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-rMIyMb-g.js} +1 -1
  213. package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-DmmZVJ7D.js} +9 -3
  214. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  215. package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-BMabyqw-.js} +49 -50
  216. package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-BfDFwGqH.js} +44 -45
  217. package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
  218. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
  219. package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-CTu4jPZ_.js} +143 -147
  220. package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-zQZDedL7.js} +1 -1
  221. package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
  222. package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
  223. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  224. package/dist/vue/index-CM3yNVUR.js +1232 -0
  225. package/dist/vue/index.js +1 -1
  226. package/dist/vue/style.css +1 -1
  227. package/package.json +1 -1
  228. package/dist/react/CacheSection-UCMptWyn.js +0 -146
  229. package/dist/react/CacheTab-CA8LB1J5.js +0 -123
  230. package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
  231. package/dist/react/EmailsSection-CM7stSyh.js +0 -262
  232. package/dist/react/EmailsTab-BDhEiomM.js +0 -153
  233. package/dist/react/EventsTab-CMfY98Rl.js +0 -63
  234. package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
  235. package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
  236. package/dist/react/JobsSection-DF3qEv9O.js +0 -187
  237. package/dist/react/JobsTab-BbrBWIOb.js +0 -141
  238. package/dist/react/LogsSection-DcFTZY7b.js +0 -227
  239. package/dist/react/LogsTab-CicucmVk.js +0 -103
  240. package/dist/react/QueriesSection-PswteoF9.js +0 -461
  241. package/dist/react/RelatedLogs-DFDOyUMr.js +0 -40
  242. package/dist/react/RequestsSection-Nag30rEA.js +0 -341
  243. package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
  244. package/dist/react/index-Cflz9Ebj.js +0 -1069
  245. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
  246. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
  247. package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
  248. package/dist/vue/index-Dtgysd26.js +0 -1229
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Parse an entry's `data` field into a Record, if possible.
3
+ *
4
+ * Handles both raw objects and JSON-encoded strings. Returns `null`
5
+ * if the field is not parseable as a plain object.
6
+ */
7
+ export declare function parseDataBlob(data: unknown): Record<string, unknown> | null;
8
+ /**
9
+ * Extract all keys from a record that are NOT in the standard log key set.
10
+ *
11
+ * Returns `null` when no non-standard keys are found.
12
+ */
13
+ export declare function extractNonStandardKeys(record: Record<string, unknown>): Record<string, unknown> | null;
@@ -8,33 +8,8 @@ export type { MetricDefinition } from './types.js';
8
8
  * the predicate returns `false` for the current stats snapshot.
9
9
  */
10
10
  export declare const METRIC_DEFINITIONS: MetricDefinition[];
11
- /**
12
- * Look up a metric definition by its ID.
13
- *
14
- * @param id - Metric identifier (e.g. `'cpu'`, `'memory'`).
15
- * @returns The matching definition, or `undefined` if not found.
16
- */
11
+ /** Look up a metric definition by its ID. */
17
12
  export declare function getMetricById(id: string): MetricDefinition | undefined;
18
- /**
19
- * Group metric definitions by their `group` field.
20
- *
21
- * Returns a `Map` where keys are group names and values are
22
- * arrays of metrics in that group. Metrics without an explicit
23
- * `group` default to `'core'`.
24
- *
25
- * The map iteration order matches first-seen order of groups
26
- * in {@link METRIC_DEFINITIONS}.
27
- *
28
- * @returns A map of group name to metric definitions.
29
- */
13
+ /** Group metric definitions by their `group` field. */
30
14
  export declare function getMetricsByGroup(): Map<string, MetricDefinition[]>;
31
- /**
32
- * Maximum number of data points to keep in the sparkline history
33
- * buffer per metric. Matches the Edge implementation.
34
- */
35
- export declare const MAX_HISTORY = 60;
36
- /**
37
- * Milliseconds after the last successful update before the connection
38
- * is considered stale (amber dot indicator).
39
- */
40
- export declare const STALE_MS = 10000;
15
+ export { MAX_HISTORY, STALE_MS } from './constants.js';
@@ -72,15 +72,6 @@ export declare function createFilterState(): FilterState;
72
72
  * @param direction - Default sort direction.
73
73
  */
74
74
  export declare function createSortState(field?: string, direction?: 'asc' | 'desc'): SortState;
75
- /**
76
- * Build a URL query parameter string from dashboard hook options.
77
- *
78
- * Accepts the flat options shape used by React/Vue hooks and converts
79
- * it to a query string compatible with the dashboard API.
80
- *
81
- * @param options - Dashboard hook options (page, perPage, search, sort, etc.).
82
- * @returns A query string (without leading `?`).
83
- */
84
75
  export declare function buildQueryParams(options: {
85
76
  page?: number;
86
77
  perPage?: number;
@@ -89,6 +89,12 @@ export declare class ServerStatsController {
89
89
  * Get the current connection mode.
90
90
  */
91
91
  getConnectionMode(): ConnectionMode;
92
+ /** Initialize the SSE subscription. Returns true if SSE failed and polling should be used. */
93
+ private initSseSubscription;
94
+ /** Set up a 3-second fallback timer to start polling if SSE hasn't connected. */
95
+ private setupSseFallbackTimer;
96
+ /** Start the stale detection interval. */
97
+ private startStaleDetection;
92
98
  /** Process incoming stats data from either SSE or polling. */
93
99
  private processStats;
94
100
  /** Poll the HTTP endpoint once. */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Build the options object for the Transmit constructor.
3
+ *
4
+ * When an authToken is provided, adds `beforeSubscribe` and
5
+ * `beforeUnsubscribe` hooks that attach a Bearer token header.
6
+ */
7
+ export declare function buildTransmitOptions(baseUrl: string, authToken?: string): Record<string, unknown>;
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Aggregated overview metrics returned by the dashboard overview endpoint.
3
+ */
4
+ export interface OverviewMetrics {
5
+ avgResponseTime: number;
6
+ p95ResponseTime: number;
7
+ requestsPerMinute: number;
8
+ errorRate: number;
9
+ totalRequests: number;
10
+ slowestEndpoints: {
11
+ url?: string;
12
+ pattern?: string;
13
+ avgDuration: number;
14
+ count: number;
15
+ }[];
16
+ queryStats: {
17
+ total: number;
18
+ avgDuration: number;
19
+ perRequest: number;
20
+ };
21
+ recentErrors: {
22
+ id?: number;
23
+ level: string;
24
+ message: string;
25
+ timestamp?: number | string;
26
+ }[];
27
+ topEvents: {
28
+ eventName?: string;
29
+ name?: string;
30
+ event_name?: string;
31
+ event?: string;
32
+ count: number;
33
+ }[];
34
+ emailActivity: {
35
+ sent: number;
36
+ queued: number;
37
+ failed: number;
38
+ };
39
+ logLevelBreakdown: {
40
+ error: number;
41
+ warn: number;
42
+ info: number;
43
+ debug: number;
44
+ };
45
+ cacheStats: {
46
+ available: boolean;
47
+ totalKeys: number;
48
+ hitRate: number;
49
+ memoryUsedHuman: string;
50
+ } | null;
51
+ jobQueueStatus: {
52
+ available: boolean;
53
+ active: number;
54
+ waiting: number;
55
+ failed: number;
56
+ completed: number;
57
+ } | null;
58
+ statusDistribution: {
59
+ '2xx': number;
60
+ '3xx': number;
61
+ '4xx': number;
62
+ '5xx': number;
63
+ };
64
+ slowestQueries: {
65
+ sqlNormalized?: string;
66
+ normalizedSql?: string;
67
+ sql_normalized?: string;
68
+ sql?: string;
69
+ avgDuration: number;
70
+ count: number;
71
+ }[];
72
+ sparklines?: {
73
+ avgResponseTime?: number[];
74
+ p95ResponseTime?: number[];
75
+ requestsPerMinute?: number[];
76
+ errorRate?: number[];
77
+ };
78
+ }
79
+ /**
80
+ * Extended overview data used by Vue dashboard components.
81
+ * Extends {@link OverviewMetrics} with sparkline time-series data.
82
+ */
83
+ export interface OverviewData extends OverviewMetrics {
84
+ avgResponseTimeSeries?: number[];
85
+ p95ResponseTimeSeries?: number[];
86
+ requestsPerMinuteSeries?: number[];
87
+ errorRateSeries?: number[];
88
+ recentErrors: {
89
+ id?: number;
90
+ level: string;
91
+ message: string;
92
+ timestamp: number | string;
93
+ }[];
94
+ }
95
+ /** Single data point for dashboard time-series charts. */
96
+ export interface ChartDataPoint {
97
+ bucket: string;
98
+ total: number;
99
+ count2xx: number;
100
+ count3xx: number;
101
+ count4xx: number;
102
+ count5xx: number;
103
+ requestCount?: number;
104
+ errorCount?: number;
105
+ avgDuration?: number;
106
+ p95Duration?: number;
107
+ }
108
+ /** A grouped/aggregated query pattern for the dashboard queries section. */
109
+ export interface GroupedQuery {
110
+ pattern: string;
111
+ count: number;
112
+ avgDuration: number;
113
+ minDuration: number;
114
+ maxDuration: number;
115
+ totalDuration: number;
116
+ percentOfTotal: number;
117
+ }
118
+ /** Redis / cache store statistics returned by the dashboard cache endpoint. */
119
+ export interface DashboardCacheStats {
120
+ connected: boolean;
121
+ hits: number;
122
+ misses: number;
123
+ hitRate: number;
124
+ memoryUsedBytes: number;
125
+ memoryUsedHuman: string;
126
+ connectedClients: number;
127
+ totalKeys: number;
128
+ keyCount?: number;
129
+ }
130
+ /** Individual cache key entry in the dashboard cache inspector. */
131
+ export interface DashboardCacheKeyEntry {
132
+ key: string;
133
+ type: string;
134
+ ttl: number;
135
+ size?: number | null;
136
+ }
137
+ /** Full response from the dashboard cache API endpoint. */
138
+ export interface DashboardCacheResponse {
139
+ available: boolean;
140
+ stats: DashboardCacheStats | null;
141
+ keys?: DashboardCacheKeyEntry[];
142
+ data?: DashboardCacheKeyEntry[];
143
+ cursor: string;
144
+ }
145
+ /**
146
+ * Server response shape from the dashboard API `/api/jobs` endpoint.
147
+ */
148
+ export interface JobsApiResponse {
149
+ available?: boolean;
150
+ overview?: JobStats;
151
+ stats?: JobStats;
152
+ data?: JobRecord[];
153
+ jobs?: JobRecord[];
154
+ total?: number;
155
+ }
156
+ /** Aggregate queue statistics. */
157
+ export interface JobStats {
158
+ active: number;
159
+ waiting: number;
160
+ delayed: number;
161
+ completed: number;
162
+ failed: number;
163
+ }
164
+ /** Individual job record from the queue inspector. */
165
+ export interface JobRecord {
166
+ id: string;
167
+ name: string;
168
+ status: string;
169
+ data: unknown;
170
+ payload: unknown;
171
+ attempts: number;
172
+ duration: number | null;
173
+ timestamp: number | string;
174
+ createdAt: number | string;
175
+ processedAt: number | string | null;
176
+ finishedAt: number | string | null;
177
+ failedReason: string | null;
178
+ }
@@ -0,0 +1,85 @@
1
+ /** Buffer usage info returned by the diagnostics endpoint. */
2
+ export interface DiagnosticsBufferInfo {
3
+ current: number;
4
+ max: number;
5
+ }
6
+ /** Collector metadata returned by the diagnostics endpoint. */
7
+ export interface DiagnosticsCollectorInfo {
8
+ name: string;
9
+ label: string;
10
+ status: 'healthy' | 'errored' | 'stopped';
11
+ lastError: string | null;
12
+ lastErrorAt: number | null;
13
+ config: Record<string, unknown>;
14
+ }
15
+ /** Timer state returned by the diagnostics endpoint. */
16
+ export interface DiagnosticsTimerInfo {
17
+ active: boolean;
18
+ intervalMs?: number;
19
+ debounceMs?: number;
20
+ }
21
+ /**
22
+ * Full diagnostics response from `GET {debugEndpoint}/diagnostics`.
23
+ *
24
+ * Used by both React `InternalsContent` and Vue `InternalsTab` / `InternalsSection`.
25
+ */
26
+ export interface DiagnosticsResponse {
27
+ package: {
28
+ version: string;
29
+ nodeVersion: string;
30
+ adonisVersion: string;
31
+ uptime?: number;
32
+ };
33
+ config: {
34
+ intervalMs: number;
35
+ transport: string;
36
+ channelName: string;
37
+ endpoint: string | false;
38
+ skipInTest: boolean;
39
+ hasOnStatsCallback: boolean;
40
+ hasShouldShowCallback: boolean;
41
+ };
42
+ devToolbar: {
43
+ enabled: boolean;
44
+ maxQueries: number;
45
+ maxEvents: number;
46
+ maxEmails: number;
47
+ maxTraces: number;
48
+ slowQueryThresholdMs: number;
49
+ tracing: boolean;
50
+ dashboard: boolean;
51
+ dashboardPath: string;
52
+ debugEndpoint: string;
53
+ retentionDays: number;
54
+ dbPath: string;
55
+ persistDebugData: boolean | string;
56
+ renderer: string;
57
+ excludeFromTracing: string[];
58
+ customPaneCount: number;
59
+ };
60
+ collectors: DiagnosticsCollectorInfo[];
61
+ buffers: Record<string, DiagnosticsBufferInfo>;
62
+ timers: Record<string, DiagnosticsTimerInfo>;
63
+ transmit: {
64
+ available: boolean;
65
+ channels: string[];
66
+ };
67
+ integrations: Record<string, {
68
+ active?: boolean;
69
+ available?: boolean;
70
+ mode?: string;
71
+ }>;
72
+ storage: {
73
+ ready: boolean;
74
+ dbPath: string;
75
+ fileSizeMb: number;
76
+ walSizeMb: number;
77
+ retentionDays: number;
78
+ tables: Array<{
79
+ name: string;
80
+ rowCount: number;
81
+ }>;
82
+ lastCleanupAt: number | null;
83
+ } | null;
84
+ uptime?: number;
85
+ }