adonisjs-server-stats 1.13.0 → 1.14.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 (150) hide show
  1. package/README.md +3 -2
  2. package/dist/configure.js +6 -1
  3. package/dist/core/collectors/collector.d.ts +83 -0
  4. package/dist/core/core/types.d.ts +186 -0
  5. package/dist/core/debug/types.d.ts +467 -0
  6. package/dist/core/index.js +184 -169
  7. package/dist/core/types.d.ts +855 -167
  8. package/dist/react/{CacheSection-CX2duJuc.js → CacheSection-DkLtukWz.js} +1 -1
  9. package/dist/react/{CacheTab-CgT4t0oZ.js → CacheTab-DWeXnEBI.js} +51 -46
  10. package/dist/react/ConfigContent-Bwvfl_G7.js +350 -0
  11. package/dist/react/{ConfigSection-Dt0FyeaW.js → ConfigSection-DaVbFPDg.js} +2 -2
  12. package/dist/react/{ConfigTab-KtiTtsrj.js → ConfigTab-D4640WJZ.js} +2 -2
  13. package/dist/react/{CustomPaneTab-15QoEplP.js → CustomPaneTab-DglmAVMC.js} +1 -1
  14. package/dist/react/{EmailsSection-YcJYR5eA.js → EmailsSection-vYx6ExTb.js} +1 -1
  15. package/dist/react/{EmailsTab-CUjubln_.js → EmailsTab-DKDrRmRH.js} +54 -49
  16. package/dist/react/{EventsSection-GGPoYSNv.js → EventsSection-CapH5xut.js} +1 -1
  17. package/dist/react/{EventsTab-Wdwr0_ny.js → EventsTab-BNVEySAm.js} +1 -1
  18. package/dist/react/{InternalsContent-BNOnSoi9.js → InternalsContent-C9lIA92C.js} +1 -1
  19. package/dist/react/{InternalsSection-BwrTfpjA.js → InternalsSection-lOv_UcSV.js} +1 -1
  20. package/dist/react/{InternalsTab--RD-L1dX.js → InternalsTab-BygoSorC.js} +1 -1
  21. package/dist/react/{JobsSection-BqqIh_DR.js → JobsSection-ZIQsJWid.js} +1 -1
  22. package/dist/react/{JobsTab-CBrU-ryL.js → JobsTab-DXQzXrDt.js} +1 -1
  23. package/dist/react/{LogEntryRow-BOrRkhRU.js → LogEntryRow-BWkHE51-.js} +1 -1
  24. package/dist/react/{LogsSection-Cm_lphM6.js → LogsSection-ConXdBkL.js} +2 -2
  25. package/dist/react/LogsTab-CJM47LPn.js +82 -0
  26. package/dist/react/{OverviewSection-XF7bakyM.js → OverviewSection-DOMu2qvl.js} +131 -131
  27. package/dist/react/{QueriesSection-DsQBKrNK.js → QueriesSection-DFsaOSJI.js} +1 -1
  28. package/dist/react/{QueriesTab-CxCC1GVq.js → QueriesTab-CY9CG_7L.js} +1 -1
  29. package/dist/react/RequestsSection-CC-eVHsl.js +326 -0
  30. package/dist/react/{RoutesSection-D0y5JQP4.js → RoutesSection-p1DMq41y.js} +1 -1
  31. package/dist/react/{RoutesTab-Y_alJVMV.js → RoutesTab-Cnqy8UcK.js} +1 -1
  32. package/dist/react/{SplitPaneWrapper-CZl1ouIT.js → SplitPaneWrapper-XgkA0QxE.js} +1 -1
  33. package/dist/react/{TimelineTab-HyqZpfbp.js → TimelineTab-1YOERxe5.js} +3 -3
  34. package/dist/react/index-DOSlCpZ9.js +1159 -0
  35. package/dist/react/index.js +1 -1
  36. package/dist/react/useApiClient-CtEG7rHs.js +11 -0
  37. package/dist/src/collectors/queue_collector.js +22 -6
  38. package/dist/src/config/deprecation_migration.js +11 -0
  39. package/dist/src/dashboard/cache_handlers.js +22 -2
  40. package/dist/src/dashboard/flush_manager.d.ts +2 -0
  41. package/dist/src/dashboard/flush_manager.js +17 -0
  42. package/dist/src/dashboard/integrations/config_inspector.d.ts +0 -1
  43. package/dist/src/dashboard/integrations/config_inspector.js +4 -2
  44. package/dist/src/dashboard/paginate_helper.d.ts +5 -0
  45. package/dist/src/dashboard/paginate_helper.js +16 -4
  46. package/dist/src/dashboard/query_explain_handler.d.ts +6 -1
  47. package/dist/src/dashboard/query_explain_handler.js +12 -2
  48. package/dist/src/dashboard/write_queue.d.ts +13 -0
  49. package/dist/src/dashboard/write_queue.js +34 -2
  50. package/dist/src/debug/debug_store.js +8 -1
  51. package/dist/src/debug/event_collector.js +4 -0
  52. package/dist/src/debug/query_collector.js +2 -0
  53. package/dist/src/debug/ring_buffer.js +8 -1
  54. package/dist/src/debug/trace_collector.js +34 -10
  55. package/dist/src/debug/types.d.ts +2 -0
  56. package/dist/src/define_config.js +1 -0
  57. package/dist/src/edge/client/dashboard.js +2 -2
  58. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  59. package/dist/src/edge/client/stats-bar.js +1 -1
  60. package/dist/src/edge/client-vue/dashboard.js +5 -5
  61. package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
  62. package/dist/src/engine/request_metrics.js +8 -10
  63. package/dist/src/log_stream/log_stream_service.d.ts +1 -0
  64. package/dist/src/log_stream/log_stream_service.js +7 -5
  65. package/dist/src/prometheus/prometheus_collector.d.ts +9 -0
  66. package/dist/src/prometheus/prometheus_collector.js +11 -0
  67. package/dist/src/provider/dashboard_init.js +15 -0
  68. package/dist/src/provider/dashboard_setup.js +9 -2
  69. package/dist/src/provider/email_bridge.js +6 -2
  70. package/dist/src/provider/email_helpers.d.ts +9 -1
  71. package/dist/src/provider/email_helpers.js +32 -4
  72. package/dist/src/provider/pino_hook.d.ts +8 -0
  73. package/dist/src/provider/pino_hook.js +19 -1
  74. package/dist/src/provider/provider_helpers_extra.d.ts +2 -0
  75. package/dist/src/provider/provider_helpers_extra.js +17 -2
  76. package/dist/src/provider/server_stats_provider.js +19 -1
  77. package/dist/src/provider/shutdown_helpers.js +2 -0
  78. package/dist/src/provider/toolbar_setup.js +17 -14
  79. package/dist/src/routes/dashboard_routes.js +96 -62
  80. package/dist/src/routes/debug_routes.js +45 -35
  81. package/dist/src/routes/no_session_middleware.d.ts +6 -3
  82. package/dist/src/routes/no_session_middleware.js +7 -3
  83. package/dist/src/routes/register_routes.d.ts +8 -0
  84. package/dist/src/routes/register_routes.js +19 -0
  85. package/dist/src/types.d.ts +31 -0
  86. package/dist/src/utils/app_import.js +12 -4
  87. package/dist/vue/CacheSection-CxEBVVkF.js +156 -0
  88. package/dist/vue/ConfigSection-BiRAiaHj.js +415 -0
  89. package/dist/vue/EmailsSection-Dl44qyqY.js +208 -0
  90. package/dist/vue/{EmailsTab-CwIF1fik.js → EmailsTab-Diya54CP.js} +6 -5
  91. package/dist/vue/{EventsSection-BpgkWIwM.js → EventsSection-CWjeitjU.js} +1 -1
  92. package/dist/vue/{InternalsTab-521fxYYj.js → InternalsTab-Z3c82glB.js} +15 -15
  93. package/dist/vue/{JobsSection-DrghFEKL.js → JobsSection-DOBb4LjZ.js} +1 -1
  94. package/dist/vue/LogsSection-CXx-HOWJ.js +260 -0
  95. package/dist/vue/{OverviewSection-BAgZTPjY.js → OverviewSection-CyfNQ8uV.js} +318 -302
  96. package/dist/vue/{QueriesSection-CUpwhp7u.js → QueriesSection-CXBsFp-y.js} +1 -1
  97. package/dist/vue/{RequestsSection-D8P2xpF2.js → RequestsSection-YTIaZGZd.js} +151 -145
  98. package/dist/vue/{RoutesSection-0qB81hTT.js → RoutesSection-CDKMey49.js} +1 -1
  99. package/dist/vue/composables/useApiClient.d.ts +8 -1
  100. package/dist/vue/index-14x39RI_.js +1239 -0
  101. package/dist/vue/index.js +1 -1
  102. package/dist/vue/style.css +1 -1
  103. package/package.json +6 -3
  104. package/dist/react/ConfigContent-CnsEI4j3.js +0 -397
  105. package/dist/react/LogsTab-jKwv9G7Q.js +0 -79
  106. package/dist/react/RequestsSection-D8cMbZU0.js +0 -321
  107. package/dist/react/index-CsprmgzI.js +0 -1121
  108. package/dist/react/useApiClient-BVtNCmnL.js +0 -9
  109. package/dist/vue/CacheSection-DRqV3YX2.js +0 -149
  110. package/dist/vue/ConfigSection-C6pQCHAL.js +0 -576
  111. package/dist/vue/EmailsSection-BTNw3ZU2.js +0 -206
  112. package/dist/vue/LogsSection-BDxx9Bfi.js +0 -258
  113. package/dist/vue/index-30jLw-_w.js +0 -1232
  114. /package/dist/core/{api-client.d.ts → core/api-client.d.ts} +0 -0
  115. /package/dist/core/{config-utils.d.ts → core/config-utils.d.ts} +0 -0
  116. /package/dist/core/{constants.d.ts → core/constants.d.ts} +0 -0
  117. /package/dist/core/{dashboard-api.d.ts → core/dashboard-api.d.ts} +0 -0
  118. /package/dist/core/{dashboard-data-controller.d.ts → core/dashboard-data-controller.d.ts} +0 -0
  119. /package/dist/core/{dashboard-data-helpers.d.ts → core/dashboard-data-helpers.d.ts} +0 -0
  120. /package/dist/core/{debug-data-controller.d.ts → core/debug-data-controller.d.ts} +0 -0
  121. /package/dist/core/{define-config-helpers.d.ts → core/define-config-helpers.d.ts} +0 -0
  122. /package/dist/core/{explain-utils.d.ts → core/explain-utils.d.ts} +0 -0
  123. /package/dist/core/{feature-detect-helpers.d.ts → core/feature-detect-helpers.d.ts} +0 -0
  124. /package/dist/core/{feature-detect.d.ts → core/feature-detect.d.ts} +0 -0
  125. /package/dist/core/{field-resolvers.d.ts → core/field-resolvers.d.ts} +0 -0
  126. /package/dist/core/{formatters-helpers.d.ts → core/formatters-helpers.d.ts} +0 -0
  127. /package/dist/core/{formatters.d.ts → core/formatters.d.ts} +0 -0
  128. /package/dist/core/{history-buffer.d.ts → core/history-buffer.d.ts} +0 -0
  129. /package/dist/core/{icons.d.ts → core/icons.d.ts} +0 -0
  130. /package/dist/core/{index.d.ts → core/index.d.ts} +0 -0
  131. /package/dist/core/{internals-utils.d.ts → core/internals-utils.d.ts} +0 -0
  132. /package/dist/core/{job-utils.d.ts → core/job-utils.d.ts} +0 -0
  133. /package/dist/core/{log-utils-helpers.d.ts → core/log-utils-helpers.d.ts} +0 -0
  134. /package/dist/core/{log-utils.d.ts → core/log-utils.d.ts} +0 -0
  135. /package/dist/core/{metrics.d.ts → core/metrics.d.ts} +0 -0
  136. /package/dist/core/{pagination.d.ts → core/pagination.d.ts} +0 -0
  137. /package/dist/core/{queries-columns.d.ts → core/queries-columns.d.ts} +0 -0
  138. /package/dist/core/{queries-controller.d.ts → core/queries-controller.d.ts} +0 -0
  139. /package/dist/core/{query-utils.d.ts → core/query-utils.d.ts} +0 -0
  140. /package/dist/core/{resizable-columns.d.ts → core/resizable-columns.d.ts} +0 -0
  141. /package/dist/core/{routes.d.ts → core/routes.d.ts} +0 -0
  142. /package/dist/core/{server-stats-controller.d.ts → core/server-stats-controller.d.ts} +0 -0
  143. /package/dist/core/{sparkline.d.ts → core/sparkline.d.ts} +0 -0
  144. /package/dist/core/{split-pane.d.ts → core/split-pane.d.ts} +0 -0
  145. /package/dist/core/{theme.d.ts → core/theme.d.ts} +0 -0
  146. /package/dist/core/{trace-utils.d.ts → core/trace-utils.d.ts} +0 -0
  147. /package/dist/core/{transmit-adapter.d.ts → core/transmit-adapter.d.ts} +0 -0
  148. /package/dist/core/{transmit-helpers.d.ts → core/transmit-helpers.d.ts} +0 -0
  149. /package/dist/core/{types-dashboard.d.ts → core/types-dashboard.d.ts} +0 -0
  150. /package/dist/core/{types-diagnostics.d.ts → core/types-diagnostics.d.ts} +0 -0
@@ -1,9 +0,0 @@
1
- import { useRef as t, useCallback as u } from "react";
2
- import { ApiClient as i } from "adonisjs-server-stats/core";
3
- function l(e = "", n) {
4
- const r = t(null);
5
- return u(() => (r.current || (r.current = new i({ baseUrl: e, authToken: n })), r.current), [e, n]);
6
- }
7
- export {
8
- l as u
9
- };
@@ -1,149 +0,0 @@
1
- import { defineComponent as E, inject as v, ref as h, computed as C, openBlock as a, createElementBlock as l, createElementVNode as e, toDisplayString as c, createCommentVNode as g, createVNode as F, unref as y, Fragment as N, renderList as A, withModifiers as B, createBlock as U } from "vue";
2
- import { u as H } from "./index-30jLw-_w.js";
3
- import { u as M } from "./useResizableTable-BoivAevK.js";
4
- import { DashboardApi as j, formatCacheSize as q, formatTtl as I } from "adonisjs-server-stats/core";
5
- import { u as G } from "./useApiClient-BQQ9CF-q.js";
6
- import { _ as J } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
7
- import { _ as O } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
8
- const P = {
9
- key: 0,
10
- class: "ss-dash-cache-stats"
11
- }, Q = { class: "ss-dash-cache-stat" }, W = { class: "ss-dash-cache-stat-value" }, X = { class: "ss-dash-cache-stat" }, Y = { class: "ss-dash-cache-stat-value" }, Z = { class: "ss-dash-cache-stat" }, ee = { class: "ss-dash-cache-stat-value" }, se = { class: "ss-dash-cache-stat" }, ae = { class: "ss-dash-cache-stat-value" }, te = {
12
- key: 1,
13
- class: "ss-dash-empty"
14
- }, le = {
15
- key: 2,
16
- class: "ss-dash-empty"
17
- }, ne = {
18
- key: 3,
19
- class: "ss-dash-table-wrap"
20
- }, oe = ["onClick"], ce = ["title"], ue = { style: { color: "var(--ss-muted)" } }, ie = ["onClick"], de = {
21
- key: 1,
22
- class: "ss-dash-empty"
23
- }, he = {
24
- key: 4,
25
- class: "ss-dash-cache-detail"
26
- }, re = {
27
- key: 0,
28
- class: "ss-dash-empty"
29
- }, ve = {
30
- key: 1,
31
- class: "ss-dash-empty",
32
- style: { color: "var(--ss-red-fg)" }
33
- }, ge = /* @__PURE__ */ E({
34
- __name: "CacheSection",
35
- setup(ye) {
36
- const w = v("ss-refresh-key", h(0)), _ = v("ss-dashboard-endpoint", "/__stats/api"), m = v("ss-auth-token", void 0), f = v("ss-base-url", ""), { data: b, loading: D, setSearch: K, mutate: z } = H(() => "cache", {
37
- baseUrl: f,
38
- dashboardEndpoint: _,
39
- authToken: m,
40
- refreshKey: w
41
- }), V = G(f || "", m), $ = new j(V(), _ || "/__stats/api"), k = h(""), u = h(null), d = h(null), p = h(!1), i = h(null), n = C(() => b.value), r = C(() => n.value?.keys || n.value?.data || []);
42
- function R(o) {
43
- k.value = o, K(o);
44
- }
45
- async function S(o) {
46
- if (confirm(`Delete cache key "${o}"?`))
47
- try {
48
- await z(`cache/${encodeURIComponent(o)}`, "delete"), u.value === o && (u.value = null, d.value = null, i.value = null);
49
- } catch {
50
- }
51
- }
52
- const { tableRef: T } = M(() => r.value);
53
- async function L(o) {
54
- if (u.value === o) {
55
- u.value = null, d.value = null, i.value = null;
56
- return;
57
- }
58
- u.value = o, d.value = null, i.value = null, p.value = !0;
59
- try {
60
- const s = await $.fetchCacheKey(o);
61
- d.value = s.value !== void 0 ? s.value : s.data !== void 0 ? s.data : s, i.value = null;
62
- } catch {
63
- d.value = null, i.value = "Failed to fetch key value";
64
- } finally {
65
- p.value = !1;
66
- }
67
- }
68
- return (o, s) => (a(), l("div", null, [
69
- n.value?.available && n.value?.stats ? (a(), l("div", P, [
70
- e("div", Q, [
71
- s[0] || (s[0] = e("span", { class: "ss-dash-cache-stat-label" }, "Hit Rate:", -1)),
72
- e("span", W, c((n.value.stats.hitRate ?? 0).toFixed(1)) + "%", 1)
73
- ]),
74
- e("div", X, [
75
- s[1] || (s[1] = e("span", { class: "ss-dash-cache-stat-label" }, "Hits:", -1)),
76
- e("span", Y, c(n.value.stats.hits ?? 0), 1)
77
- ]),
78
- e("div", Z, [
79
- s[2] || (s[2] = e("span", { class: "ss-dash-cache-stat-label" }, "Misses:", -1)),
80
- e("span", ee, c(n.value.stats.misses ?? 0), 1)
81
- ]),
82
- e("div", se, [
83
- s[3] || (s[3] = e("span", { class: "ss-dash-cache-stat-label" }, "Keys:", -1)),
84
- e("span", ae, c(n.value.stats.totalKeys || n.value.stats.keyCount || r.value.length || 0), 1)
85
- ])
86
- ])) : g("", !0),
87
- F(O, {
88
- "model-value": k.value,
89
- placeholder: "Filter cache keys...",
90
- summary: `${r.value.length} keys`,
91
- "onUpdate:modelValue": R
92
- }, null, 8, ["model-value", "summary"]),
93
- y(D) && !y(b) ? (a(), l("div", te, "Loading cache...")) : !n.value || !n.value.available ? (a(), l("div", le, " Cache inspector not available ")) : (a(), l("div", ne, [
94
- r.value.length > 0 ? (a(), l("table", {
95
- key: 0,
96
- ref_key: "tableRef",
97
- ref: T,
98
- class: "ss-dash-table"
99
- }, [
100
- s[4] || (s[4] = e("thead", null, [
101
- e("tr", null, [
102
- e("th", null, "Key"),
103
- e("th", null, "Type"),
104
- e("th", null, "Size"),
105
- e("th", null, "TTL"),
106
- e("th")
107
- ])
108
- ], -1)),
109
- e("tbody", null, [
110
- (a(!0), l(N, null, A(r.value, (t) => (a(), l("tr", {
111
- key: t.key,
112
- class: "ss-dash-clickable",
113
- onClick: (x) => L(t.key)
114
- }, [
115
- e("td", null, [
116
- e("span", {
117
- title: t.key,
118
- style: { color: "var(--ss-sql-color)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", display: "block" }
119
- }, c(t.key), 9, ce)
120
- ]),
121
- e("td", null, [
122
- e("span", ue, c(t.type), 1)
123
- ]),
124
- e("td", null, c(t.size !== null && t.size !== void 0 && t.size > 0 ? y(q)(t.size) : "-"), 1),
125
- e("td", null, c(t.ttl > 0 ? y(I)(t.ttl) : "-"), 1),
126
- e("td", null, [
127
- e("button", {
128
- type: "button",
129
- class: "ss-dash-retry-btn",
130
- onClick: B((x) => S(t.key), ["stop"])
131
- }, " Delete ", 8, ie)
132
- ])
133
- ], 8, oe))), 128))
134
- ])
135
- ], 512)) : (a(), l("div", de, "No cache keys found"))
136
- ])),
137
- u.value ? (a(), l("div", he, [
138
- e("h4", null, "Key: " + c(u.value), 1),
139
- p.value ? (a(), l("div", re, "Loading value...")) : i.value ? (a(), l("div", ve, c(i.value), 1)) : (a(), U(J, {
140
- key: 2,
141
- value: d.value
142
- }, null, 8, ["value"]))
143
- ])) : g("", !0)
144
- ]));
145
- }
146
- });
147
- export {
148
- ge as default
149
- };