adonisjs-server-stats 1.9.0 → 1.10.3

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 (227) 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/formatters-helpers.d.ts +23 -0
  10. package/dist/core/index.js +596 -509
  11. package/dist/core/log-utils-helpers.d.ts +13 -0
  12. package/dist/core/metrics.d.ts +3 -28
  13. package/dist/core/pagination.d.ts +0 -9
  14. package/dist/core/server-stats-controller.d.ts +6 -0
  15. package/dist/core/split-pane.d.ts +18 -0
  16. package/dist/core/trace-utils.d.ts +5 -0
  17. package/dist/core/transmit-helpers.d.ts +7 -0
  18. package/dist/core/types-dashboard.d.ts +178 -0
  19. package/dist/core/types-diagnostics.d.ts +85 -0
  20. package/dist/core/types.d.ts +11 -443
  21. package/dist/react/{CacheSection-xH75hwXu.js → CacheSection-baMZotSn.js} +2 -2
  22. package/dist/react/CacheTab-2cw_rMzj.js +117 -0
  23. package/dist/react/{ConfigSection-D8BO1Ry9.js → ConfigSection-DGgqjAal.js} +1 -1
  24. package/dist/react/{ConfigTab-CcN-tfjv.js → ConfigTab-H3OnYqmK.js} +1 -1
  25. package/dist/react/CustomPaneTab-B6r7ha0u.js +98 -0
  26. package/dist/react/{EmailsSection-BzlsTdPs.js → EmailsSection-C-UZISG-.js} +2 -2
  27. package/dist/react/EmailsTab-DbK4Eobn.js +139 -0
  28. package/dist/react/{EventsSection-CGQWiIdV.js → EventsSection-C7RQW_LY.js} +2 -2
  29. package/dist/react/EventsTab-CfVr7AiM.js +57 -0
  30. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  31. package/dist/react/{JobsSection-D7AHQmZi.js → JobsSection-CQHNK_Ls.js} +2 -2
  32. package/dist/react/{JobsTab-B3Lfdqed.js → JobsTab-znzf6jzk.js} +54 -42
  33. package/dist/react/{LogsSection-Cly1dpvS.js → LogsSection-Dmm3rE2B.js} +9 -3
  34. package/dist/react/LogsTab-D8unMV5P.js +108 -0
  35. package/dist/react/{OverviewSection-CkBGFEWq.js → OverviewSection-ABP9ueBo.js} +1 -1
  36. package/dist/react/{QueriesSection-CfCpnNUD.js → QueriesSection-CnmSkznA.js} +2 -2
  37. package/dist/react/{QueriesTab-DbBmAqzO.js → QueriesTab-BQzcxEiW.js} +37 -40
  38. package/dist/react/RelatedLogs-3A8RuGKH.js +52 -0
  39. package/dist/react/RequestsSection-kW79_M7k.js +341 -0
  40. package/dist/react/{RoutesSection-CRqF-cNM.js → RoutesSection-BRhxrtjZ.js} +2 -2
  41. package/dist/react/RoutesTab-CpYH5lUw.js +68 -0
  42. package/dist/react/TimelineTab-DjLR35Ce.js +214 -0
  43. package/dist/react/index-CsImORX6.js +1121 -0
  44. package/dist/react/index.js +1 -1
  45. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  46. package/dist/react/react/components/shared/RelatedLogs.d.ts +7 -0
  47. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  48. package/dist/react/style.css +1 -1
  49. package/dist/src/collectors/app_collector.d.ts +0 -8
  50. package/dist/src/collectors/app_collector.js +45 -52
  51. package/dist/src/collectors/auto_detect.d.ts +0 -23
  52. package/dist/src/collectors/auto_detect.js +33 -55
  53. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  54. package/dist/src/collectors/db_pool_collector.js +72 -57
  55. package/dist/src/collectors/log_collector.d.ts +0 -47
  56. package/dist/src/collectors/log_collector.js +36 -65
  57. package/dist/src/collectors/queue_collector.d.ts +0 -20
  58. package/dist/src/collectors/queue_collector.js +60 -76
  59. package/dist/src/collectors/redis_collector.d.ts +10 -10
  60. package/dist/src/collectors/redis_collector.js +69 -66
  61. package/dist/src/config/deprecation_migration.d.ts +7 -0
  62. package/dist/src/config/deprecation_migration.js +201 -0
  63. package/dist/src/controller/debug_controller.d.ts +1 -1
  64. package/dist/src/controller/debug_controller.js +87 -81
  65. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  66. package/dist/src/dashboard/cache_handlers.js +52 -0
  67. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  68. package/dist/src/dashboard/chart_aggregator.js +68 -50
  69. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  70. package/dist/src/dashboard/coalesce_cache.js +47 -0
  71. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  72. package/dist/src/dashboard/dashboard_controller.js +52 -532
  73. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  74. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  75. package/dist/src/dashboard/dashboard_store.d.ts +19 -217
  76. package/dist/src/dashboard/dashboard_store.js +115 -1069
  77. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  78. package/dist/src/dashboard/dashboard_types.js +4 -0
  79. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  80. package/dist/src/dashboard/detail_queries.js +98 -0
  81. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  82. package/dist/src/dashboard/email_event_builder.js +65 -0
  83. package/dist/src/dashboard/explain_query.d.ts +8 -0
  84. package/dist/src/dashboard/explain_query.js +22 -0
  85. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  86. package/dist/src/dashboard/filter_handlers.js +56 -0
  87. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  88. package/dist/src/dashboard/filtered_queries.js +155 -0
  89. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  90. package/dist/src/dashboard/flush_manager.js +107 -0
  91. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  92. package/dist/src/dashboard/format_helpers.js +140 -0
  93. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  94. package/dist/src/dashboard/inspector_manager.js +102 -0
  95. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  96. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  97. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  98. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  99. package/dist/src/dashboard/jobs_handlers.js +61 -0
  100. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  101. package/dist/src/dashboard/knex_factory.js +91 -0
  102. package/dist/src/dashboard/migrator.js +30 -153
  103. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  104. package/dist/src/dashboard/migrator_tables.js +153 -0
  105. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  106. package/dist/src/dashboard/overview_queries.js +155 -0
  107. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  108. package/dist/src/dashboard/overview_query_runners.js +84 -0
  109. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  110. package/dist/src/dashboard/overview_store_queries.js +69 -0
  111. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  112. package/dist/src/dashboard/paginate_helper.js +33 -0
  113. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  114. package/dist/src/dashboard/query_explain_handler.js +80 -0
  115. package/dist/src/dashboard/read_queries.d.ts +32 -0
  116. package/dist/src/dashboard/read_queries.js +107 -0
  117. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  118. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  119. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  120. package/dist/src/dashboard/storage_stats.js +81 -0
  121. package/dist/src/dashboard/write_queue.d.ts +106 -0
  122. package/dist/src/dashboard/write_queue.js +225 -0
  123. package/dist/src/data/data_access.d.ts +6 -36
  124. package/dist/src/data/data_access.js +43 -188
  125. package/dist/src/data/data_access_helpers.d.ts +130 -0
  126. package/dist/src/data/data_access_helpers.js +212 -0
  127. package/dist/src/debug/debug_store.js +37 -32
  128. package/dist/src/debug/email_collector.d.ts +1 -10
  129. package/dist/src/debug/email_collector.js +78 -81
  130. package/dist/src/debug/event_collector.d.ts +0 -9
  131. package/dist/src/debug/event_collector.js +79 -62
  132. package/dist/src/debug/query_collector.js +23 -19
  133. package/dist/src/debug/route_inspector.d.ts +1 -5
  134. package/dist/src/debug/route_inspector.js +50 -51
  135. package/dist/src/debug/trace_collector.d.ts +10 -2
  136. package/dist/src/debug/trace_collector.js +23 -16
  137. package/dist/src/debug/types.d.ts +5 -1
  138. package/dist/src/define_config.d.ts +0 -65
  139. package/dist/src/define_config.js +93 -333
  140. package/dist/src/edge/client/dashboard.js +2 -2
  141. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  142. package/dist/src/edge/client/stats-bar.js +1 -1
  143. package/dist/src/edge/client-vue/dashboard.js +5 -5
  144. package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
  145. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  146. package/dist/src/edge/plugin.d.ts +0 -16
  147. package/dist/src/edge/plugin.js +57 -64
  148. package/dist/src/engine/request_metrics.d.ts +1 -0
  149. package/dist/src/engine/request_metrics.js +32 -42
  150. package/dist/src/middleware/request_tracking_middleware.d.ts +3 -8
  151. package/dist/src/middleware/request_tracking_middleware.js +65 -91
  152. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  153. package/dist/src/provider/auth_middleware_detector.js +97 -0
  154. package/dist/src/provider/boot_helpers.d.ts +20 -0
  155. package/dist/src/provider/boot_helpers.js +91 -0
  156. package/dist/src/provider/boot_initializer.d.ts +28 -0
  157. package/dist/src/provider/boot_initializer.js +35 -0
  158. package/dist/src/provider/dashboard_init.d.ts +30 -0
  159. package/dist/src/provider/dashboard_init.js +138 -0
  160. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  161. package/dist/src/provider/dashboard_setup.js +78 -0
  162. package/dist/src/provider/diagnostics.d.ts +134 -0
  163. package/dist/src/provider/diagnostics.js +127 -0
  164. package/dist/src/provider/email_bridge.d.ts +43 -0
  165. package/dist/src/provider/email_bridge.js +80 -0
  166. package/dist/src/provider/email_helpers.d.ts +13 -0
  167. package/dist/src/provider/email_helpers.js +68 -0
  168. package/dist/src/provider/pino_hook.d.ts +17 -0
  169. package/dist/src/provider/pino_hook.js +35 -0
  170. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  171. package/dist/src/provider/provider_helpers_extra.js +177 -0
  172. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  173. package/dist/src/provider/server_stats_provider.js +131 -936
  174. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  175. package/dist/src/provider/shutdown_helpers.js +70 -0
  176. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  177. package/dist/src/provider/toolbar_setup.js +141 -0
  178. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  179. package/dist/src/routes/dashboard_routes.js +197 -0
  180. package/dist/src/routes/debug_routes.d.ts +14 -0
  181. package/dist/src/routes/debug_routes.js +101 -0
  182. package/dist/src/routes/register_routes.d.ts +0 -78
  183. package/dist/src/routes/register_routes.js +22 -347
  184. package/dist/src/routes/stats_routes.d.ts +5 -0
  185. package/dist/src/routes/stats_routes.js +14 -0
  186. package/dist/src/styles/components.css +177 -0
  187. package/dist/src/styles/dashboard.css +8 -90
  188. package/dist/src/styles/debug-panel.css +10 -31
  189. package/dist/src/types.d.ts +306 -15
  190. package/dist/vue/{CacheSection-Cx-hj09X.js → CacheSection-ITqvpfH5.js} +1 -1
  191. package/dist/vue/{ConfigSection-CMXyryf6.js → ConfigSection-DTn3GslE.js} +1 -1
  192. package/dist/vue/{EmailsSection-DgKl9xGT.js → EmailsSection-DtLJ4XoS.js} +1 -1
  193. package/dist/vue/{EventsSection-BNMCAim1.js → EventsSection-BOYYz0Ty.js} +1 -1
  194. package/dist/vue/{JobsSection-CCMgMlxd.js → JobsSection-BazTxcJL.js} +1 -1
  195. package/dist/vue/{LogsSection-CvOnTxUu.js → LogsSection-D55PjTKX.js} +9 -3
  196. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  197. package/dist/vue/{OverviewSection-CHgaKtUR.js → OverviewSection-1uBKo-Tu.js} +1 -1
  198. package/dist/vue/{QueriesSection-BnHRD98z.js → QueriesSection-rpoZ4ogd.js} +1 -1
  199. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +84 -0
  200. package/dist/vue/RequestsSection-x7LvT0MC.js +401 -0
  201. package/dist/vue/{RoutesSection-BrceOcKQ.js → RoutesSection-CCD0zZqQ.js} +1 -1
  202. package/dist/vue/TimelineTab-zj5Z5OdT.js +338 -0
  203. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +4 -0
  204. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +4 -0
  205. package/dist/vue/components/{Dashboard/sections/TimelineSection.vue.d.ts → shared/RelatedLogs.vue.d.ts} +5 -6
  206. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  207. package/dist/vue/index-C8MxnS7Q.js +1232 -0
  208. package/dist/vue/index.js +1 -1
  209. package/dist/vue/style.css +1 -1
  210. package/package.json +1 -1
  211. package/dist/react/CacheTab-DYmsZJJ1.js +0 -123
  212. package/dist/react/CustomPaneTab-D7_o3Ec6.js +0 -104
  213. package/dist/react/EmailsTab-Uh2CQY3o.js +0 -153
  214. package/dist/react/EventsTab-CC6DQzEm.js +0 -63
  215. package/dist/react/LogsTab-BbYK-iyh.js +0 -103
  216. package/dist/react/RequestsSection-Cb5a6MlT.js +0 -209
  217. package/dist/react/RoutesTab-Bwreij3e.js +0 -74
  218. package/dist/react/TimelineSection-B2y06kRE.js +0 -158
  219. package/dist/react/TimelineTab-6hthfdBB.js +0 -193
  220. package/dist/react/WaterfallChart-Cj73WdfM.js +0 -100
  221. package/dist/react/index-CecA4IdQ.js +0 -1075
  222. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +0 -8
  223. package/dist/vue/RequestsSection-B-uSlM0f.js +0 -243
  224. package/dist/vue/TimelineSection-CfvnA2Oo.js +0 -186
  225. package/dist/vue/TimelineTab-Db6lKKsD.js +0 -250
  226. package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +0 -118
  227. package/dist/vue/index-oLxS08vN.js +0 -1235
@@ -1,250 +0,0 @@
1
- import { defineComponent as z, ref as h, computed as x, onBeforeUnmount as F, openBlock as s, createElementBlock as l, Fragment as i, createElementVNode as t, toDisplayString as n, normalizeClass as b, unref as u, renderList as _, normalizeStyle as B, createTextVNode as D, createCommentVNode as T, withDirectives as P, vModelText as G, withModifiers as H } from "vue";
2
- import { formatDuration as y, TAB_ICONS as A, formatTime as I, timeAgo as W, durationSeverity as Y } from "adonisjs-server-stats/core";
3
- import { u as j } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as J } from "./useResizableTable-BoivAevK.js";
5
- const K = {
6
- key: 0,
7
- class: "ss-dbg-empty"
8
- }, Q = { class: "ss-dbg-empty" }, X = { class: "ss-dbg-tl-detail-header" }, Z = { class: "ss-dbg-tl-detail-url" }, ee = { class: "ss-dbg-tl-meta" }, te = { class: "ss-dbg-tl-legend" }, se = { id: "ss-dbg-tl-waterfall" }, le = {
9
- key: 0,
10
- class: "ss-dbg-empty"
11
- }, ae = ["title"], ne = { class: "ss-dbg-tl-track" }, oe = ["title"], de = { class: "ss-dbg-tl-dur" }, re = {
12
- key: 0,
13
- class: "ss-dbg-tl-warnings"
14
- }, ie = {
15
- key: 3,
16
- class: "ss-dbg-empty"
17
- }, ue = { class: "ss-dbg-search-bar" }, ce = { class: "ss-dbg-summary" }, be = {
18
- key: 0,
19
- class: "ss-dbg-empty"
20
- }, ge = ["onClick"], ve = {
21
- class: "ss-dbg-c-dim",
22
- style: { "white-space": "nowrap" }
23
- }, he = { class: "ss-dbg-c-text" }, me = ["href"], fe = ["viewBox", "innerHTML"], pe = {
24
- class: "ss-dbg-c-muted",
25
- style: { "text-align": "center" }
26
- }, _e = ["title"], xe = /* @__PURE__ */ z({
27
- __name: "TimelineTab",
28
- props: {
29
- data: {},
30
- dashboardPath: {},
31
- baseUrl: {},
32
- debugEndpoint: {},
33
- authToken: {}
34
- },
35
- setup(k) {
36
- const m = k, f = h(""), g = h(null), d = h(null), w = h(!1), c = h(null), S = j(m.baseUrl || "", m.authToken), p = x(() => {
37
- const o = m.data;
38
- if (!o) return [];
39
- const a = Array.isArray(o) ? o : o.traces || [];
40
- if (!f.value.trim()) return a;
41
- const e = f.value.toLowerCase();
42
- return a.filter(
43
- (r) => r.url.toLowerCase().includes(e) || r.method.toLowerCase().includes(e) || String(r.statusCode).includes(e)
44
- );
45
- }), C = {
46
- request: "#1e3a5f",
47
- middleware: "rgba(30, 58, 95, 0.7)",
48
- db: "#6d28d9",
49
- view: "#0e7490",
50
- mail: "#059669",
51
- event: "#b45309",
52
- custom: "#525252"
53
- }, M = {
54
- request: "Request",
55
- middleware: "Middleware",
56
- db: "Database",
57
- view: "View",
58
- mail: "Mail",
59
- event: "Event",
60
- custom: "Custom"
61
- };
62
- function R(o) {
63
- g.value === o.id ? (g.value = null, d.value = null, c.value = null) : (g.value = o.id, N(o.id));
64
- }
65
- function L() {
66
- g.value = null, d.value = null, c.value = null;
67
- }
68
- let v = null;
69
- async function N(o) {
70
- v && v.abort(), v = new AbortController(), w.value = !0, c.value = null, d.value = null;
71
- const a = m.debugEndpoint || "/admin/api/debug";
72
- try {
73
- const r = await S().get(`${a}/traces/${o}`);
74
- d.value = r;
75
- } catch (e) {
76
- if (e instanceof Error && e.name === "AbortError") return;
77
- c.value = e instanceof Error ? e.message : "Failed to load trace";
78
- } finally {
79
- w.value = !1;
80
- }
81
- }
82
- const $ = x(() => d.value?.spans || []), E = x(() => d.value?.warnings || []);
83
- function O(o, a) {
84
- const e = a || 1, r = e > 0 ? o.startOffset / e * 100 : 0, q = e > 0 ? Math.max(o.duration / e * 100, 0.5) : 0.5;
85
- return {
86
- left: `${r}%`,
87
- width: `${q}%`,
88
- background: C[o.category] || C.custom
89
- };
90
- }
91
- const { tableRef: U } = J(() => p.value);
92
- F(() => {
93
- v && v.abort();
94
- });
95
- function V(o) {
96
- const a = Y(o);
97
- return a === "very-slow" ? "ss-dbg-very-slow" : a === "slow" ? "ss-dbg-slow" : "";
98
- }
99
- return (o, a) => (s(), l("div", null, [
100
- g.value !== null ? (s(), l(i, { key: 0 }, [
101
- w.value ? (s(), l("div", K, "Loading trace detail...")) : c.value ? (s(), l(i, { key: 1 }, [
102
- t("div", { class: "ss-dbg-tl-detail-header" }, [
103
- t("button", {
104
- type: "button",
105
- class: "ss-dbg-btn-clear",
106
- onClick: L
107
- }, "← Back")
108
- ]),
109
- t("div", Q, "Error: " + n(c.value), 1)
110
- ], 64)) : d.value ? (s(), l(i, { key: 2 }, [
111
- t("div", X, [
112
- t("button", {
113
- type: "button",
114
- class: "ss-dbg-btn-clear",
115
- onClick: L
116
- }, "← Back"),
117
- t("span", {
118
- class: b(`ss-dbg-method ss-dbg-method-${d.value.method.toLowerCase()}`)
119
- }, n(d.value.method), 3),
120
- t("span", Z, n(d.value.url), 1),
121
- t("span", {
122
- class: b(`ss-dbg-status ss-dbg-status-${Math.floor(d.value.statusCode / 100)}xx`)
123
- }, n(d.value.statusCode), 3),
124
- t("span", ee, n(u(y)(d.value.totalDuration)) + " · " + n(d.value.spanCount) + " spans ", 1)
125
- ]),
126
- t("div", te, [
127
- (s(), l(i, null, _(C, (e, r) => t("span", {
128
- key: r,
129
- class: "ss-dbg-tl-legend-item"
130
- }, [
131
- t("span", {
132
- class: "ss-dbg-tl-legend-dot",
133
- style: B({ background: e })
134
- }, null, 4),
135
- D(" " + n(M[r] || r), 1)
136
- ])), 64))
137
- ]),
138
- t("div", se, [
139
- $.value.length === 0 ? (s(), l("div", le, " No spans captured for this request ")) : T("", !0),
140
- (s(!0), l(i, null, _($.value, (e) => (s(), l("div", {
141
- key: e.id,
142
- class: "ss-dbg-tl-row"
143
- }, [
144
- t("span", {
145
- class: "ss-dbg-tl-label",
146
- title: e.label
147
- }, n(e.label), 9, ae),
148
- t("span", ne, [
149
- t("span", {
150
- class: b(`ss-dbg-tl-bar ss-dbg-tl-bar-${e.category}`),
151
- style: B(O(e, d.value.totalDuration)),
152
- title: `${e.label}: ${u(y)(e.duration)}`
153
- }, null, 14, oe)
154
- ]),
155
- t("span", de, n(u(y)(e.duration)), 1)
156
- ]))), 128))
157
- ]),
158
- E.value.length > 0 ? (s(), l("div", re, [
159
- a[2] || (a[2] = t("div", { class: "ss-dbg-tl-warnings-title" }, "Warnings", -1)),
160
- (s(!0), l(i, null, _(E.value, (e, r) => (s(), l("div", {
161
- key: r,
162
- class: "ss-dbg-tl-warning"
163
- }, n(e), 1))), 128))
164
- ])) : T("", !0)
165
- ], 64)) : (s(), l("div", ie, "Loading trace detail..."))
166
- ], 64)) : (s(), l(i, { key: 1 }, [
167
- t("div", ue, [
168
- P(t("input", {
169
- "onUpdate:modelValue": a[0] || (a[0] = (e) => f.value = e),
170
- class: "ss-dbg-search",
171
- placeholder: "Filter traces...",
172
- type: "text"
173
- }, null, 512), [
174
- [G, f.value]
175
- ]),
176
- t("span", ce, n(p.value.length) + " traces", 1)
177
- ]),
178
- p.value.length === 0 ? (s(), l("div", be, "No traces captured")) : (s(), l("table", {
179
- key: 1,
180
- ref_key: "tableRef",
181
- ref: U,
182
- class: "ss-dbg-table"
183
- }, [
184
- a[3] || (a[3] = t("thead", null, [
185
- t("tr", null, [
186
- t("th", null, "#"),
187
- t("th", null, "Method"),
188
- t("th", null, "URL"),
189
- t("th", null, "Status"),
190
- t("th", null, "Duration"),
191
- t("th", null, "Spans"),
192
- t("th", null, "Time")
193
- ])
194
- ], -1)),
195
- t("tbody", null, [
196
- (s(!0), l(i, null, _(p.value, (e) => (s(), l("tr", {
197
- key: e.id,
198
- class: "ss-dbg-email-row",
199
- onClick: (r) => R(e)
200
- }, [
201
- t("td", ve, n(e.id), 1),
202
- t("td", null, [
203
- t("span", {
204
- class: b(`ss-dbg-method ss-dbg-method-${e.method.toLowerCase()}`)
205
- }, n(e.method), 3)
206
- ]),
207
- t("td", he, [
208
- D(n(e.url) + " ", 1),
209
- k.dashboardPath ? (s(), l("a", {
210
- key: 0,
211
- href: `${k.dashboardPath}#timeline?id=${e.id}`,
212
- target: "_blank",
213
- class: "ss-dbg-deeplink",
214
- onClick: a[1] || (a[1] = H(() => {
215
- }, ["stop"]))
216
- }, [
217
- (s(), l("svg", {
218
- viewBox: u(A)["open-external"].viewBox,
219
- width: "12",
220
- height: "12",
221
- fill: "none",
222
- stroke: "currentColor",
223
- "stroke-width": "2",
224
- innerHTML: u(A)["open-external"].elements.join("")
225
- }, null, 8, fe))
226
- ], 8, me)) : T("", !0)
227
- ]),
228
- t("td", null, [
229
- t("span", {
230
- class: b(`ss-dbg-status ss-dbg-status-${Math.floor(e.statusCode / 100)}xx`)
231
- }, n(e.statusCode), 3)
232
- ]),
233
- t("td", {
234
- class: b(["ss-dbg-duration", V(e.totalDuration)])
235
- }, n(u(y)(e.totalDuration)), 3),
236
- t("td", pe, n(e.spanCount), 1),
237
- t("td", {
238
- class: "ss-dbg-event-time",
239
- title: u(I)(e.timestamp)
240
- }, n(u(W)(e.timestamp)), 9, _e)
241
- ], 8, ge))), 128))
242
- ])
243
- ], 512))
244
- ], 64))
245
- ]));
246
- }
247
- });
248
- export {
249
- xe as default
250
- };
@@ -1,118 +0,0 @@
1
- import { defineComponent as B, computed as c, openBlock as n, createElementBlock as l, normalizeClass as u, createElementVNode as a, Fragment as m, renderList as h, normalizeStyle as g, toDisplayString as d, createTextVNode as L, createCommentVNode as O } from "vue";
2
- const S = {
3
- key: 0,
4
- class: "ss-dash-empty"
5
- }, D = { class: "ss-dash-tl-legend" }, E = ["title"], N = { class: "ss-dash-tl-track" }, F = ["title"], M = { class: "ss-dash-tl-dur" }, R = {
6
- key: 0,
7
- class: "ss-dash-tl-warnings"
8
- }, T = { class: "ss-dash-tl-warnings-title" }, q = /* @__PURE__ */ B({
9
- __name: "WaterfallChart",
10
- props: {
11
- spans: {},
12
- totalDuration: {},
13
- className: {},
14
- warnings: {}
15
- },
16
- setup(r) {
17
- const o = r, f = {
18
- request: "#1e3a5f",
19
- middleware: "rgba(30, 58, 95, 0.7)",
20
- db: "#6d28d9",
21
- view: "#0e7490",
22
- mail: "#059669",
23
- event: "#b45309",
24
- custom: "var(--ss-dim)"
25
- }, _ = {
26
- request: "Request",
27
- middleware: "Middleware",
28
- db: "DB",
29
- mail: "Mail",
30
- event: "Event",
31
- view: "View",
32
- custom: "Custom"
33
- }, v = c(() => o.spans || []), b = c(
34
- () => [...v.value].sort((t, s) => t.startOffset - s.startOffset)
35
- ), y = c(() => {
36
- const t = {};
37
- for (const s of b.value)
38
- t[s.id] = s.parentId ? (t[s.parentId] || 0) + 1 : 0;
39
- return t;
40
- });
41
- function $(t) {
42
- const s = o.totalDuration || 1;
43
- return `${t.startOffset / s * 100}%`;
44
- }
45
- function k(t) {
46
- const s = o.totalDuration || 1;
47
- return `${Math.max(t.duration / s * 100, 0.5)}%`;
48
- }
49
- function x(t) {
50
- return t.length > 50 ? t.slice(0, 50) + "..." : t;
51
- }
52
- function C(t) {
53
- return t === "db" ? "DB" : t;
54
- }
55
- function p(t) {
56
- return t === "db" ? "purple" : t === "mail" ? "green" : t === "event" ? "amber" : t === "view" ? "blue" : "muted";
57
- }
58
- function w(t) {
59
- const s = t.metadata ? Object.entries(t.metadata).filter(([, e]) => e != null).map(([e, i]) => `${e}=${i}`).join(", ") : "";
60
- return s ? `${t.label} (${t.duration.toFixed(2)}ms)
61
- ${s}` : `${t.label} (${t.duration.toFixed(2)}ms)`;
62
- }
63
- return (t, s) => v.value.length === 0 ? (n(), l("div", S, "No spans recorded")) : (n(), l("div", {
64
- key: 1,
65
- class: u(`ss-dash-tl-waterfall ${r.className || ""}`)
66
- }, [
67
- a("div", D, [
68
- (n(), l(m, null, h(_, (e, i) => a("div", {
69
- key: i,
70
- class: "ss-dash-tl-legend-item"
71
- }, [
72
- a("span", {
73
- class: "ss-dash-tl-legend-dot",
74
- style: g({ background: f[i] || f.custom })
75
- }, null, 4),
76
- a("span", null, d(e), 1)
77
- ])), 64))
78
- ]),
79
- (n(!0), l(m, null, h(b.value, (e) => (n(), l("div", {
80
- key: e.id,
81
- class: "ss-dash-tl-row"
82
- }, [
83
- a("div", {
84
- class: "ss-dash-tl-label",
85
- title: w(e),
86
- style: g({ paddingLeft: 8 + (y.value[e.id] || 0) * 16 + "px" })
87
- }, [
88
- a("span", {
89
- class: u(`ss-dash-badge ss-dash-badge-${p(e.category)}`),
90
- style: { "font-size": "9px", "margin-right": "4px" }
91
- }, d(C(e.category)), 3),
92
- L(" " + d(x(e.label)), 1)
93
- ], 12, E),
94
- a("div", N, [
95
- a("div", {
96
- class: u(`ss-dash-tl-bar ss-dash-tl-bar-${e.category || "custom"}`),
97
- style: g({
98
- left: $(e),
99
- width: k(e)
100
- }),
101
- title: w(e)
102
- }, null, 14, F)
103
- ]),
104
- a("span", M, d(e.duration.toFixed(2)) + "ms", 1)
105
- ]))), 128)),
106
- r.warnings && r.warnings.length > 0 ? (n(), l("div", R, [
107
- a("div", T, "Warnings (" + d(r.warnings.length) + ")", 1),
108
- (n(!0), l(m, null, h(r.warnings, (e, i) => (n(), l("div", {
109
- key: i,
110
- class: "ss-dash-tl-warning"
111
- }, d(e), 1))), 128))
112
- ])) : O("", !0)
113
- ], 2));
114
- }
115
- });
116
- export {
117
- q as _
118
- };