adonisjs-server-stats 1.11.5 → 1.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -6
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +550 -468
- package/dist/core/types-diagnostics.d.ts +2 -0
- package/dist/react/{CacheSection-BYN53kYO.js → CacheSection-DOUnyUrw.js} +1 -1
- package/dist/react/{CacheTab-DOhuK05d.js → CacheTab-D9o6bsPc.js} +1 -1
- package/dist/react/{ConfigSection-B9EHh4Rp.js → ConfigSection-DzNC7pOJ.js} +1 -1
- package/dist/react/{ConfigTab-C8kriE2b.js → ConfigTab-CT-Tu-ct.js} +1 -1
- package/dist/react/{CustomPaneTab-CvzQS_Wh.js → CustomPaneTab-CvIPe7NP.js} +1 -1
- package/dist/react/{EmailsSection-BJyFJf7A.js → EmailsSection-B1LT7Nx3.js} +1 -1
- package/dist/react/{EmailsTab-Ch8jp10B.js → EmailsTab-DKxK322z.js} +1 -1
- package/dist/react/{EventsSection-DJPwHeT8.js → EventsSection-D3AK0mhw.js} +1 -1
- package/dist/react/{EventsTab-B-FoehXC.js → EventsTab-BRRSW6RI.js} +1 -1
- package/dist/react/InternalsContent-BNOnSoi9.js +393 -0
- package/dist/react/{InternalsSection-B6VlVx5f.js → InternalsSection-BwrTfpjA.js} +1 -1
- package/dist/react/{InternalsTab-CkEKpRMU.js → InternalsTab--RD-L1dX.js} +1 -1
- package/dist/react/{JobsSection-DWF4i1t_.js → JobsSection-BMvj5886.js} +1 -1
- package/dist/react/{JobsTab-DqnifQXV.js → JobsTab-CQXWCrl8.js} +1 -1
- package/dist/react/{LogEntryRow-CMMkqA9M.js → LogEntryRow-DFI52ZEw.js} +1 -1
- package/dist/react/{LogsSection-C1xC5aP4.js → LogsSection-CW2hQ976.js} +2 -2
- package/dist/react/{LogsTab-CS4sLfLw.js → LogsTab-CV4Gf_yb.js} +2 -2
- package/dist/react/{OverviewSection-CxvfOR0v.js → OverviewSection-CxF9cabq.js} +1 -1
- package/dist/react/{QueriesSection-CrMdU5Ax.js → QueriesSection-CZJ-imAb.js} +117 -101
- package/dist/react/{QueriesTab-x85PjkyS.js → QueriesTab-CQHa1ck3.js} +23 -14
- package/dist/react/{RequestsSection-DETN9oZb.js → RequestsSection-Cb5YeqvI.js} +2 -2
- package/dist/react/{RoutesSection-CmorkJeC.js → RoutesSection-B43olD9v.js} +1 -1
- package/dist/react/{RoutesTab-CbzBOzpc.js → RoutesTab-RfhCUbkx.js} +1 -1
- package/dist/react/{SplitPaneWrapper-BiIgT4ND.js → SplitPaneWrapper-B05Mg6Sg.js} +1 -1
- package/dist/react/{TimelineTab-Ue9tUD_n.js → TimelineTab-Dx4686Ti.js} +2 -2
- package/dist/react/components/Dashboard/shared/DataTable.d.ts +1 -1
- package/dist/react/{index-DwDK-4oX.js → index-C4EMJrkH.js} +2 -2
- package/dist/react/index.js +1 -1
- package/dist/react/style.css +1 -1
- package/dist/src/collectors/db_pool_collector.js +17 -23
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +3 -3
- package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
- package/dist/src/provider/diagnostics.d.ts +3 -0
- package/dist/src/provider/diagnostics.js +1 -0
- package/dist/src/provider/server_stats_provider.d.ts +7 -0
- package/dist/src/provider/server_stats_provider.js +36 -0
- package/dist/src/styles/components.css +16 -0
- package/dist/src/styles/dashboard.css +27 -18
- package/dist/vue/{CacheSection-DT2Mwf_s.js → CacheSection-BAotiuQq.js} +1 -1
- package/dist/vue/{ConfigSection-BwKwS9lh.js → ConfigSection-JZjK5E5F.js} +1 -1
- package/dist/vue/{EmailsSection-B65g0FVS.js → EmailsSection-BLwyQO7B.js} +1 -1
- package/dist/vue/{EventsSection-CxqtVF-o.js → EventsSection-BUEwO-0A.js} +1 -1
- package/dist/vue/{InternalsSection-BJUXE-5F.js → InternalsSection-jhTCuK3j.js} +149 -130
- package/dist/vue/{InternalsTab-DEMjqtlw.js → InternalsTab-521fxYYj.js} +152 -133
- package/dist/vue/{JobsSection-rMIyMb-g.js → JobsSection-21A0yQMq.js} +1 -1
- package/dist/vue/{LogsSection-DmmZVJ7D.js → LogsSection-BmOx8SNa.js} +1 -1
- package/dist/vue/{OverviewSection-BMabyqw-.js → OverviewSection-BRDK3Ony.js} +1 -1
- package/dist/vue/QueriesSection-D2WGsuR4.js +444 -0
- package/dist/vue/QueriesTab-6D_xfi7Q.js +114 -0
- package/dist/vue/{RequestsSection-CTu4jPZ_.js → RequestsSection-DLrjCfcE.js} +1 -1
- package/dist/vue/{RoutesSection-zQZDedL7.js → RoutesSection-CPr9w42B.js} +1 -1
- package/dist/vue/{index-CM3yNVUR.js → index-CYaqRGIT.js} +2 -2
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/react/InternalsContent-O8ino9oM.js +0 -370
- package/dist/vue/QueriesSection-BfDFwGqH.js +0 -428
- package/dist/vue/QueriesTab-DuTG7cpC.js +0 -106
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, inject as A, ref as $, computed as g, openBlock as o, createElementBlock as i, createVNode as W, withCtx as it, createElementVNode as e, normalizeClass as f, unref as r, createTextVNode as b, toDisplayString as u, createCommentVNode as v, Fragment as k, renderList as T, withKeys as B, withModifiers as L, createBlock as ut, h as D } from "vue";
|
|
2
|
-
import { formatTime as rt, timeAgo as dt, SLOW_DURATION_MS as pt, durationClassName as ct } from "adonisjs-server-stats/core";
|
|
3
|
-
import { u as vt } from "./index-CM3yNVUR.js";
|
|
4
|
-
import { u as ht } from "./useResizableTable-BoivAevK.js";
|
|
5
|
-
import { _ as mt } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
|
|
6
|
-
import { _ as ft } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
|
|
7
|
-
const yt = { class: "ss-dash-btn-group" }, xt = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "ss-dash-empty"
|
|
10
|
-
}, _t = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "ss-dash-table-wrap"
|
|
13
|
-
}, bt = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "ss-dash-sort-arrow"
|
|
16
|
-
}, kt = {
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "ss-dash-sort-arrow"
|
|
19
|
-
}, wt = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "ss-dash-sort-arrow"
|
|
22
|
-
}, Ct = ["onClick", "onKeydown"], $t = {
|
|
23
|
-
key: 0,
|
|
24
|
-
class: "ss-dash-dup"
|
|
25
|
-
}, gt = { style: { color: "var(--ss-muted)", "text-align": "center", display: "block" } }, Dt = { class: "ss-dash-duration" }, Nt = { class: "ss-dash-duration" }, Pt = { style: { color: "var(--ss-muted)", "text-align": "center", display: "block" } }, St = {
|
|
26
|
-
key: 1,
|
|
27
|
-
class: "ss-dash-empty"
|
|
28
|
-
}, Tt = { class: "ss-dash-table-wrap" }, zt = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "ss-dash-sort-arrow"
|
|
31
|
-
}, jt = {
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "ss-dash-sort-arrow"
|
|
34
|
-
}, At = { style: { color: "var(--ss-dim)" } }, Ft = ["onClick", "onKeydown"], Kt = {
|
|
35
|
-
key: 0,
|
|
36
|
-
class: "ss-dash-dup"
|
|
37
|
-
}, Rt = ["title"], Et = { style: { color: "var(--ss-dim)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" } }, Lt = ["title"], Mt = ["disabled", "onClick"], Ot = {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: "ss-dash-explain-row"
|
|
40
|
-
}, Vt = {
|
|
41
|
-
colspan: "8",
|
|
42
|
-
class: "ss-dash-explain"
|
|
43
|
-
}, qt = { style: { display: "flex", "justify-content": "space-between", "align-items": "start" } }, Ut = { style: { flex: "1" } }, Qt = {
|
|
44
|
-
key: 0,
|
|
45
|
-
class: "ss-dash-explain-result ss-dash-explain-error"
|
|
46
|
-
}, Wt = { key: 0 }, Bt = {
|
|
47
|
-
key: 1,
|
|
48
|
-
class: "ss-dash-explain-result"
|
|
49
|
-
}, Ht = {
|
|
50
|
-
key: 2,
|
|
51
|
-
class: "ss-dash-explain-result"
|
|
52
|
-
}, It = {
|
|
53
|
-
key: 3,
|
|
54
|
-
class: "ss-dash-explain-result"
|
|
55
|
-
}, Jt = {
|
|
56
|
-
key: 1,
|
|
57
|
-
class: "ss-dash-empty"
|
|
58
|
-
};
|
|
59
|
-
function I(n, z) {
|
|
60
|
-
if (!n) return null;
|
|
61
|
-
const F = z * 20, K = n["Node Type"] || "Unknown", j = n["Relation Name"] || "", c = n.Alias && n.Alias !== n["Relation Name"] ? ` (${n.Alias})` : "", d = n["Index Name"] || "", a = [];
|
|
62
|
-
if (n["Startup Cost"] !== null && n["Startup Cost"] !== void 0 && a.push(`cost=${n["Startup Cost"]}..${n["Total Cost"]}`), n["Plan Rows"] !== null && n["Plan Rows"] !== void 0 && a.push(`rows=${n["Plan Rows"]}`), n["Plan Width"] !== null && n["Plan Width"] !== void 0 && a.push(`width=${n["Plan Width"]}`), n.Filter && a.push(`filter: ${n.Filter}`), n["Index Cond"] && a.push(`cond: ${n["Index Cond"]}`), n["Hash Cond"] && a.push(`hash: ${n["Hash Cond"]}`), n["Join Type"] && a.push(`join: ${n["Join Type"]}`), n["Sort Key"]) {
|
|
63
|
-
const N = Array.isArray(n["Sort Key"]) ? n["Sort Key"].join(", ") : n["Sort Key"];
|
|
64
|
-
a.push(`sort: ${N}`);
|
|
65
|
-
}
|
|
66
|
-
const y = n.Plans || [];
|
|
67
|
-
return D("div", { class: "ss-dash-explain-node", style: { marginLeft: `${F}px` } }, [
|
|
68
|
-
D("div", { class: "ss-dash-explain-node-header" }, [
|
|
69
|
-
D("span", { class: "ss-dash-explain-node-type" }, K),
|
|
70
|
-
j ? [" on ", D("strong", null, j)] : null,
|
|
71
|
-
c || null,
|
|
72
|
-
d ? [" using ", D("em", null, d)] : null
|
|
73
|
-
]),
|
|
74
|
-
a.length > 0 ? D("div", { class: "ss-dash-explain-metrics" }, a.join(" · ")) : null,
|
|
75
|
-
...y.map((N, w) => I(N, z + 1))
|
|
76
|
-
]);
|
|
77
|
-
}
|
|
78
|
-
const J = H({
|
|
79
|
-
name: "ExplainPlanNode",
|
|
80
|
-
props: {
|
|
81
|
-
node: { type: Object, required: !0 },
|
|
82
|
-
depth: { type: Number, default: 0 }
|
|
83
|
-
},
|
|
84
|
-
setup(n) {
|
|
85
|
-
return () => I(n.node, n.depth);
|
|
86
|
-
}
|
|
87
|
-
}), Gt = { components: { ExplainPlanNode: J } }, ls = /* @__PURE__ */ H({
|
|
88
|
-
...Gt,
|
|
89
|
-
__name: "QueriesSection",
|
|
90
|
-
setup(n) {
|
|
91
|
-
const z = A("ss-refresh-key", $(0)), F = A("ss-dashboard-endpoint", "/__stats/api"), K = A("ss-auth-token", void 0), j = A("ss-base-url", ""), c = $("list"), d = $(null), a = $(null), y = $(null), N = g(() => c.value === "grouped" ? "queries/grouped" : "queries"), { data: w, loading: G, pagination: P, sort: h, goToPage: X, setSearch: Y, setSort: Z, explainQuery: tt } = vt(() => N.value, {
|
|
92
|
-
baseUrl: j,
|
|
93
|
-
dashboardEndpoint: F,
|
|
94
|
-
authToken: K,
|
|
95
|
-
refreshKey: z
|
|
96
|
-
}), M = $(""), O = g(() => w.value ? c.value === "grouped" ? w.value.groups || [] : w.value.data || w.value || [] : []), m = g(() => c.value !== "grouped" ? O.value : O.value.map((s) => {
|
|
97
|
-
const t = { ...s };
|
|
98
|
-
return (t.sqlNormalized === null || t.sqlNormalized === void 0 && (s.sql_normalized || s.pattern)) && (t.sqlNormalized = s.sql_normalized || s.pattern || ""), (t.count === null || t.count === void 0) && s.total_count !== null && s.total_count !== void 0 && (t.count = s.total_count), (t.avgDuration === null || t.avgDuration === void 0) && s.avg_duration !== null && s.avg_duration !== void 0 && (t.avgDuration = s.avg_duration), (t.maxDuration === null || t.maxDuration === void 0) && s.max_duration !== null && s.max_duration !== void 0 && (t.maxDuration = s.max_duration), (t.minDuration === null || t.minDuration === void 0) && s.min_duration !== null && s.min_duration !== void 0 && (t.minDuration = s.min_duration), (t.totalDuration === null || t.totalDuration === void 0) && s.total_duration !== null && s.total_duration !== void 0 && (t.totalDuration = s.total_duration), (t.percentOfTotal === null || t.percentOfTotal === void 0) && s.pct_time !== null && s.pct_time !== void 0 && (t.percentOfTotal = s.pct_time), t;
|
|
99
|
-
})), R = g(() => {
|
|
100
|
-
const s = /* @__PURE__ */ new Map();
|
|
101
|
-
for (const t of m.value) {
|
|
102
|
-
const l = t.sqlNormalized || t.sql || t.sql_text || "";
|
|
103
|
-
s.set(l, (s.get(l) || 0) + 1);
|
|
104
|
-
}
|
|
105
|
-
return s;
|
|
106
|
-
}), C = g(() => {
|
|
107
|
-
const s = P.total ?? m.value.length;
|
|
108
|
-
let t = 0, l = 0, p = 0, x = 0;
|
|
109
|
-
for (const _ of m.value) {
|
|
110
|
-
const Q = _.duration || 0;
|
|
111
|
-
p += Q, x++, Q > pt && t++;
|
|
112
|
-
}
|
|
113
|
-
for (const _ of R.value.values())
|
|
114
|
-
_ > 1 && (l += _);
|
|
115
|
-
return { total: s, slow: t, duplicates: l, avgDuration: x > 0 ? p / x : 0 };
|
|
116
|
-
}), st = g(() => {
|
|
117
|
-
if (c.value === "grouped") return `${m.value.length} query patterns`;
|
|
118
|
-
const s = [`${C.value.total} queries`];
|
|
119
|
-
return C.value.slow > 0 && s.push(`${C.value.slow} slow`), C.value.duplicates > 0 && s.push(`${C.value.duplicates} dup`), s.push(`avg ${(C.value.avgDuration || 0).toFixed(1)}ms`), s.join(", ");
|
|
120
|
-
});
|
|
121
|
-
function et(s) {
|
|
122
|
-
M.value = s, Y(s);
|
|
123
|
-
}
|
|
124
|
-
function V(s) {
|
|
125
|
-
s !== c.value && (c.value = s, d.value = null, a.value = null, y.value = null);
|
|
126
|
-
}
|
|
127
|
-
function S(s) {
|
|
128
|
-
Z(s);
|
|
129
|
-
}
|
|
130
|
-
async function lt(s) {
|
|
131
|
-
if (a.value && a.value.queryId === s) {
|
|
132
|
-
a.value = null;
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
y.value = s;
|
|
136
|
-
try {
|
|
137
|
-
const t = await tt(s);
|
|
138
|
-
t && t.error ? a.value = { queryId: s, plan: [], error: t.error, message: t.message } : a.value = { queryId: s, plan: t?.plan || t?.rows || [] };
|
|
139
|
-
} catch (t) {
|
|
140
|
-
a.value = {
|
|
141
|
-
queryId: s,
|
|
142
|
-
plan: [],
|
|
143
|
-
error: t instanceof Error ? t.message : String(t)
|
|
144
|
-
};
|
|
145
|
-
} finally {
|
|
146
|
-
y.value = null;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function E(s) {
|
|
150
|
-
return ct(s, "ss-dash");
|
|
151
|
-
}
|
|
152
|
-
function q() {
|
|
153
|
-
const s = a.value?.plan;
|
|
154
|
-
return !s || s.length === 0 || typeof s[0] != "object" || !s[0] ? [] : Object.keys(s[0]);
|
|
155
|
-
}
|
|
156
|
-
function nt(s, t) {
|
|
157
|
-
if (!s || typeof s != "object") return "-";
|
|
158
|
-
const l = s[t];
|
|
159
|
-
return l != null ? String(l) : "-";
|
|
160
|
-
}
|
|
161
|
-
function at() {
|
|
162
|
-
const s = a.value?.plan;
|
|
163
|
-
return !s || s.length === 0 || typeof s[0] != "object" || !s[0] ? !1 : "Plan" in s[0];
|
|
164
|
-
}
|
|
165
|
-
function ot() {
|
|
166
|
-
const s = a.value?.plan;
|
|
167
|
-
return !s || s.length === 0 || typeof s[0] != "object" || !s[0] ? {} : s[0].Plan;
|
|
168
|
-
}
|
|
169
|
-
const { tableRef: U } = ht(() => m.value);
|
|
170
|
-
return (s, t) => (o(), i("div", null, [
|
|
171
|
-
W(mt, {
|
|
172
|
-
"model-value": M.value,
|
|
173
|
-
placeholder: "Filter queries...",
|
|
174
|
-
summary: st.value,
|
|
175
|
-
"onUpdate:modelValue": et
|
|
176
|
-
}, {
|
|
177
|
-
default: it(() => [
|
|
178
|
-
e("div", yt, [
|
|
179
|
-
e("button", {
|
|
180
|
-
type: "button",
|
|
181
|
-
class: f(`ss-dash-btn ${c.value === "list" ? "ss-dash-active" : ""}`),
|
|
182
|
-
onClick: t[0] || (t[0] = (l) => V("list"))
|
|
183
|
-
}, " List ", 2),
|
|
184
|
-
e("button", {
|
|
185
|
-
type: "button",
|
|
186
|
-
class: f(`ss-dash-btn ${c.value === "grouped" ? "ss-dash-active" : ""}`),
|
|
187
|
-
onClick: t[1] || (t[1] = (l) => V("grouped"))
|
|
188
|
-
}, " Grouped ", 2)
|
|
189
|
-
])
|
|
190
|
-
]),
|
|
191
|
-
_: 1
|
|
192
|
-
}, 8, ["model-value", "summary"]),
|
|
193
|
-
r(G) && !r(w) ? (o(), i("div", xt, "Loading queries...")) : c.value === "grouped" ? (o(), i("div", _t, [
|
|
194
|
-
m.value.length > 0 ? (o(), i("table", {
|
|
195
|
-
key: 0,
|
|
196
|
-
ref_key: "tableRef",
|
|
197
|
-
ref: U,
|
|
198
|
-
class: "ss-dash-table"
|
|
199
|
-
}, [
|
|
200
|
-
e("thead", null, [
|
|
201
|
-
e("tr", null, [
|
|
202
|
-
t[11] || (t[11] = e("th", null, "Pattern", -1)),
|
|
203
|
-
e("th", {
|
|
204
|
-
class: "ss-dash-sortable",
|
|
205
|
-
onClick: t[2] || (t[2] = (l) => S("count"))
|
|
206
|
-
}, [
|
|
207
|
-
t[8] || (t[8] = b(" Count ", -1)),
|
|
208
|
-
r(h).column === "count" ? (o(), i("span", bt, u(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : v("", !0)
|
|
209
|
-
]),
|
|
210
|
-
e("th", {
|
|
211
|
-
class: "ss-dash-sortable",
|
|
212
|
-
onClick: t[3] || (t[3] = (l) => S("avgDuration"))
|
|
213
|
-
}, [
|
|
214
|
-
t[9] || (t[9] = b(" Avg ", -1)),
|
|
215
|
-
r(h).column === "avgDuration" ? (o(), i("span", kt, u(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : v("", !0)
|
|
216
|
-
]),
|
|
217
|
-
t[12] || (t[12] = e("th", null, "Min", -1)),
|
|
218
|
-
t[13] || (t[13] = e("th", null, "Max", -1)),
|
|
219
|
-
e("th", {
|
|
220
|
-
class: "ss-dash-sortable",
|
|
221
|
-
onClick: t[4] || (t[4] = (l) => S("totalDuration"))
|
|
222
|
-
}, [
|
|
223
|
-
t[10] || (t[10] = b(" Total ", -1)),
|
|
224
|
-
r(h).column === "totalDuration" ? (o(), i("span", wt, u(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : v("", !0)
|
|
225
|
-
]),
|
|
226
|
-
t[14] || (t[14] = e("th", null, "% Time", -1))
|
|
227
|
-
])
|
|
228
|
-
]),
|
|
229
|
-
e("tbody", null, [
|
|
230
|
-
(o(!0), i(k, null, T(m.value, (l, p) => (o(), i("tr", { key: p }, [
|
|
231
|
-
e("td", null, [
|
|
232
|
-
e("span", {
|
|
233
|
-
class: f(`ss-dash-sql ${d.value === l.sqlNormalized ? "ss-dash-expanded" : ""}`),
|
|
234
|
-
title: "Click to expand",
|
|
235
|
-
role: "button",
|
|
236
|
-
tabindex: "0",
|
|
237
|
-
onClick: L((x) => d.value = d.value === l.sqlNormalized ? null : l.sqlNormalized, ["stop"]),
|
|
238
|
-
onKeydown: B((x) => d.value = d.value === l.sqlNormalized ? null : l.sqlNormalized, ["enter"])
|
|
239
|
-
}, u(l.sqlNormalized), 43, Ct),
|
|
240
|
-
(l.count || 0) >= 3 ? (o(), i("span", $t, "DUP")) : v("", !0)
|
|
241
|
-
]),
|
|
242
|
-
e("td", null, [
|
|
243
|
-
e("span", gt, u(l.count || 0), 1)
|
|
244
|
-
]),
|
|
245
|
-
e("td", null, [
|
|
246
|
-
e("span", {
|
|
247
|
-
class: f(`ss-dash-duration ${E(l.avgDuration || 0)}`)
|
|
248
|
-
}, u((l.avgDuration || 0).toFixed(2)) + "ms ", 3)
|
|
249
|
-
]),
|
|
250
|
-
e("td", null, [
|
|
251
|
-
e("span", Dt, u((l.minDuration || 0).toFixed(2)) + "ms", 1)
|
|
252
|
-
]),
|
|
253
|
-
e("td", null, [
|
|
254
|
-
e("span", {
|
|
255
|
-
class: f(`ss-dash-duration ${E(l.maxDuration || 0)}`)
|
|
256
|
-
}, u((l.maxDuration || 0).toFixed(2)) + "ms ", 3)
|
|
257
|
-
]),
|
|
258
|
-
e("td", null, [
|
|
259
|
-
e("span", Nt, u((l.totalDuration || 0).toFixed(1)) + "ms", 1)
|
|
260
|
-
]),
|
|
261
|
-
e("td", null, [
|
|
262
|
-
e("span", Pt, u((l.percentOfTotal || 0).toFixed(1)) + "%", 1)
|
|
263
|
-
])
|
|
264
|
-
]))), 128))
|
|
265
|
-
])
|
|
266
|
-
], 512)) : (o(), i("div", St, "No queries recorded"))
|
|
267
|
-
])) : (o(), i(k, { key: 2 }, [
|
|
268
|
-
e("div", Tt, [
|
|
269
|
-
m.value.length > 0 ? (o(), i("table", {
|
|
270
|
-
key: 0,
|
|
271
|
-
ref_key: "tableRef",
|
|
272
|
-
ref: U,
|
|
273
|
-
class: "ss-dash-table"
|
|
274
|
-
}, [
|
|
275
|
-
t[24] || (t[24] = e("colgroup", null, [
|
|
276
|
-
e("col", { style: { width: "40px" } }),
|
|
277
|
-
e("col"),
|
|
278
|
-
e("col", { style: { width: "70px" } }),
|
|
279
|
-
e("col", { style: { width: "60px" } }),
|
|
280
|
-
e("col", { style: { width: "90px" } }),
|
|
281
|
-
e("col", { style: { width: "80px" } }),
|
|
282
|
-
e("col", { style: { width: "90px" } }),
|
|
283
|
-
e("col", { style: { width: "70px" } })
|
|
284
|
-
], -1)),
|
|
285
|
-
e("thead", null, [
|
|
286
|
-
e("tr", null, [
|
|
287
|
-
t[17] || (t[17] = e("th", null, "#", -1)),
|
|
288
|
-
t[18] || (t[18] = e("th", null, "SQL", -1)),
|
|
289
|
-
e("th", {
|
|
290
|
-
class: "ss-dash-sortable",
|
|
291
|
-
onClick: t[5] || (t[5] = (l) => S("duration"))
|
|
292
|
-
}, [
|
|
293
|
-
t[15] || (t[15] = b(" Duration ", -1)),
|
|
294
|
-
r(h).column === "duration" ? (o(), i("span", zt, u(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : v("", !0)
|
|
295
|
-
]),
|
|
296
|
-
t[19] || (t[19] = e("th", null, "Method", -1)),
|
|
297
|
-
t[20] || (t[20] = e("th", null, "Model", -1)),
|
|
298
|
-
t[21] || (t[21] = e("th", null, "Connection", -1)),
|
|
299
|
-
e("th", {
|
|
300
|
-
class: "ss-dash-sortable",
|
|
301
|
-
onClick: t[6] || (t[6] = (l) => S("createdAt"))
|
|
302
|
-
}, [
|
|
303
|
-
t[16] || (t[16] = b(" Time ", -1)),
|
|
304
|
-
r(h).column === "createdAt" ? (o(), i("span", jt, u(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : v("", !0)
|
|
305
|
-
]),
|
|
306
|
-
t[22] || (t[22] = e("th", null, null, -1))
|
|
307
|
-
])
|
|
308
|
-
]),
|
|
309
|
-
e("tbody", null, [
|
|
310
|
-
(o(!0), i(k, null, T(m.value, (l) => (o(), i(k, {
|
|
311
|
-
key: l.id
|
|
312
|
-
}, [
|
|
313
|
-
e("tr", null, [
|
|
314
|
-
e("td", null, [
|
|
315
|
-
e("span", At, u(l.id), 1)
|
|
316
|
-
]),
|
|
317
|
-
e("td", null, [
|
|
318
|
-
e("div", null, [
|
|
319
|
-
e("span", {
|
|
320
|
-
class: f(`ss-dash-sql ${d.value === l.id ? "ss-dash-expanded" : ""}`),
|
|
321
|
-
title: "Click to expand",
|
|
322
|
-
role: "button",
|
|
323
|
-
tabindex: "0",
|
|
324
|
-
onClick: L((p) => d.value = d.value === l.id ? null : l.id, ["stop"]),
|
|
325
|
-
onKeydown: B((p) => d.value = d.value === l.id ? null : l.id, ["enter"])
|
|
326
|
-
}, u(l.sql || l.sql_text || ""), 43, Ft),
|
|
327
|
-
(R.value.get(
|
|
328
|
-
(l.sqlNormalized || l.sql || l.sql_text) ?? ""
|
|
329
|
-
) ?? 0) > 1 ? (o(), i("span", Kt, " ×" + u(R.value.get(
|
|
330
|
-
(l.sqlNormalized || l.sql || l.sql_text) ?? ""
|
|
331
|
-
)), 1)) : v("", !0)
|
|
332
|
-
])
|
|
333
|
-
]),
|
|
334
|
-
e("td", null, [
|
|
335
|
-
e("span", {
|
|
336
|
-
class: f(`ss-dash-duration ${E(l.duration || 0)}`)
|
|
337
|
-
}, u((l.duration || 0).toFixed(2)) + "ms ", 3)
|
|
338
|
-
]),
|
|
339
|
-
e("td", null, [
|
|
340
|
-
e("span", {
|
|
341
|
-
class: f(`ss-dash-method ss-dash-method-${(l.method || l.sql_method || "").toLowerCase()}`)
|
|
342
|
-
}, u(l.method || l.sql_method || ""), 3)
|
|
343
|
-
]),
|
|
344
|
-
e("td", null, [
|
|
345
|
-
e("span", {
|
|
346
|
-
style: { color: "var(--ss-muted)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" },
|
|
347
|
-
title: l.model
|
|
348
|
-
}, u(l.model || "-"), 9, Rt)
|
|
349
|
-
]),
|
|
350
|
-
e("td", null, [
|
|
351
|
-
e("span", Et, u(l.connection || "-"), 1)
|
|
352
|
-
]),
|
|
353
|
-
e("td", null, [
|
|
354
|
-
e("span", {
|
|
355
|
-
class: "ss-dash-event-time",
|
|
356
|
-
title: r(rt)(
|
|
357
|
-
l.createdAt || l.created_at || l.timestamp || ""
|
|
358
|
-
)
|
|
359
|
-
}, u(r(dt)(
|
|
360
|
-
l.createdAt || l.created_at || l.timestamp || ""
|
|
361
|
-
)), 9, Lt)
|
|
362
|
-
]),
|
|
363
|
-
e("td", null, [
|
|
364
|
-
(l.method || l.sql_method || "") === "select" ? (o(), i("button", {
|
|
365
|
-
key: 0,
|
|
366
|
-
type: "button",
|
|
367
|
-
class: f(`ss-dash-explain-btn${a.value?.queryId === l.id && !a.value?.error ? " ss-dash-explain-btn-active" : ""}`),
|
|
368
|
-
disabled: y.value === l.id,
|
|
369
|
-
onClick: L((p) => lt(l.id), ["stop"])
|
|
370
|
-
}, u(y.value === l.id ? "..." : "EXPLAIN"), 11, Mt)) : v("", !0)
|
|
371
|
-
])
|
|
372
|
-
]),
|
|
373
|
-
a.value && a.value.queryId === l.id ? (o(), i("tr", Ot, [
|
|
374
|
-
e("td", Vt, [
|
|
375
|
-
e("div", qt, [
|
|
376
|
-
e("div", Ut, [
|
|
377
|
-
a.value.error ? (o(), i("div", Qt, [
|
|
378
|
-
t[23] || (t[23] = e("strong", null, "Error:", -1)),
|
|
379
|
-
b(" " + u(a.value.error) + " ", 1),
|
|
380
|
-
a.value.message ? (o(), i("br", Wt)) : v("", !0),
|
|
381
|
-
b(" " + u(a.value.message), 1)
|
|
382
|
-
])) : at() ? (o(), i("div", Bt, [
|
|
383
|
-
W(r(J), {
|
|
384
|
-
node: ot(),
|
|
385
|
-
depth: 0
|
|
386
|
-
}, null, 8, ["node"])
|
|
387
|
-
])) : a.value.plan && a.value.plan.length > 0 && typeof a.value.plan[0] == "object" ? (o(), i("div", Ht, [
|
|
388
|
-
e("table", null, [
|
|
389
|
-
e("thead", null, [
|
|
390
|
-
e("tr", null, [
|
|
391
|
-
(o(!0), i(k, null, T(q(), (p) => (o(), i("th", { key: p }, u(p), 1))), 128))
|
|
392
|
-
])
|
|
393
|
-
]),
|
|
394
|
-
e("tbody", null, [
|
|
395
|
-
(o(!0), i(k, null, T(a.value.plan, (p, x) => (o(), i("tr", { key: x }, [
|
|
396
|
-
(o(!0), i(k, null, T(q(), (_) => (o(), i("td", { key: _ }, u(nt(p, _)), 1))), 128))
|
|
397
|
-
]))), 128))
|
|
398
|
-
])
|
|
399
|
-
])
|
|
400
|
-
])) : (o(), i("div", It, "No plan data returned"))
|
|
401
|
-
]),
|
|
402
|
-
e("button", {
|
|
403
|
-
type: "button",
|
|
404
|
-
class: "ss-dash-explain-btn",
|
|
405
|
-
style: { "margin-left": "8px", "flex-shrink": "0" },
|
|
406
|
-
onClick: t[7] || (t[7] = (p) => a.value = null)
|
|
407
|
-
}, " Close ")
|
|
408
|
-
])
|
|
409
|
-
])
|
|
410
|
-
])) : v("", !0)
|
|
411
|
-
], 64))), 128))
|
|
412
|
-
])
|
|
413
|
-
], 512)) : (o(), i("div", Jt, "No queries recorded"))
|
|
414
|
-
]),
|
|
415
|
-
r(P).totalPages > 1 ? (o(), ut(ft, {
|
|
416
|
-
key: 0,
|
|
417
|
-
page: r(P).page,
|
|
418
|
-
"last-page": r(P).totalPages,
|
|
419
|
-
total: r(P).total,
|
|
420
|
-
onPageChange: r(X)
|
|
421
|
-
}, null, 8, ["page", "last-page", "total", "onPageChange"])) : v("", !0)
|
|
422
|
-
], 64))
|
|
423
|
-
]));
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
export {
|
|
427
|
-
ls as default
|
|
428
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as D, computed as d, openBlock as l, createElementBlock as n, createElementVNode as e, withDirectives as Q, vModelText as N, toDisplayString as a, Fragment as S, renderList as E, withKeys as A, normalizeClass as h, createCommentVNode as f, unref as v } from "vue";
|
|
2
|
-
import { filterQueries as K, countDuplicateQueries as L, computeQuerySummary as M, formatDuration as y, formatTime as R, timeAgo as V, durationClassName as z } from "adonisjs-server-stats/core";
|
|
3
|
-
import { u as B } from "./useResizableTable-BoivAevK.js";
|
|
4
|
-
const F = { class: "ss-dbg-search-bar" }, I = { class: "ss-dbg-summary" }, P = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "ss-dbg-empty"
|
|
7
|
-
}, U = {
|
|
8
|
-
class: "ss-dbg-c-dim",
|
|
9
|
-
style: { "white-space": "nowrap" }
|
|
10
|
-
}, X = ["onClick", "onKeydown"], j = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "ss-dbg-dup"
|
|
13
|
-
}, G = {
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "ss-dbg-dup"
|
|
16
|
-
}, H = { class: "ss-dbg-c-muted" }, J = ["title"], Z = /* @__PURE__ */ $({
|
|
17
|
-
__name: "QueriesTab",
|
|
18
|
-
props: {
|
|
19
|
-
data: {},
|
|
20
|
-
dashboardPath: {}
|
|
21
|
-
},
|
|
22
|
-
setup(_) {
|
|
23
|
-
const b = _, c = D(""), r = /* @__PURE__ */ new Set(), m = d(() => {
|
|
24
|
-
if (!b.data) return [];
|
|
25
|
-
const s = b.data;
|
|
26
|
-
return (Array.isArray(s) ? s : s.queries) || [];
|
|
27
|
-
}), o = d(() => K(m.value, c.value)), p = d(() => L(m.value)), u = d(() => M(m.value, p.value)), C = d(() => {
|
|
28
|
-
let s = `${o.value.length} queries`;
|
|
29
|
-
return u.value.slowCount > 0 && (s += ` | ${u.value.slowCount} slow`), u.value.dupCount > 0 && (s += ` | ${u.value.dupCount} dup`), o.value.length > 0 && (s += ` | avg ${y(u.value.avgDuration)}`), s;
|
|
30
|
-
});
|
|
31
|
-
function g(s) {
|
|
32
|
-
r.has(s) ? r.delete(s) : r.add(s);
|
|
33
|
-
}
|
|
34
|
-
function w(s) {
|
|
35
|
-
return r.has(s);
|
|
36
|
-
}
|
|
37
|
-
function k(s) {
|
|
38
|
-
return z(s, "ss-dbg");
|
|
39
|
-
}
|
|
40
|
-
const { tableRef: x } = B(() => o.value);
|
|
41
|
-
return (s, i) => (l(), n("div", null, [
|
|
42
|
-
e("div", F, [
|
|
43
|
-
Q(e("input", {
|
|
44
|
-
"onUpdate:modelValue": i[0] || (i[0] = (t) => c.value = t),
|
|
45
|
-
class: "ss-dbg-search",
|
|
46
|
-
placeholder: "Filter queries...",
|
|
47
|
-
type: "text"
|
|
48
|
-
}, null, 512), [
|
|
49
|
-
[N, c.value]
|
|
50
|
-
]),
|
|
51
|
-
e("span", I, a(C.value), 1)
|
|
52
|
-
]),
|
|
53
|
-
o.value.length === 0 ? (l(), n("div", P, "No queries captured")) : (l(), n("table", {
|
|
54
|
-
key: 1,
|
|
55
|
-
ref_key: "tableRef",
|
|
56
|
-
ref: x,
|
|
57
|
-
class: "ss-dbg-table"
|
|
58
|
-
}, [
|
|
59
|
-
i[1] || (i[1] = e("thead", null, [
|
|
60
|
-
e("tr", null, [
|
|
61
|
-
e("th", null, "#"),
|
|
62
|
-
e("th", null, "SQL"),
|
|
63
|
-
e("th", null, "Duration"),
|
|
64
|
-
e("th", null, "Method"),
|
|
65
|
-
e("th", null, "Model"),
|
|
66
|
-
e("th", null, "Time")
|
|
67
|
-
])
|
|
68
|
-
], -1)),
|
|
69
|
-
e("tbody", null, [
|
|
70
|
-
(l(!0), n(S, null, E(o.value, (t) => (l(), n("tr", {
|
|
71
|
-
key: t.id
|
|
72
|
-
}, [
|
|
73
|
-
e("td", U, a(t.id), 1),
|
|
74
|
-
e("td", null, [
|
|
75
|
-
e("span", {
|
|
76
|
-
class: h(["ss-dbg-sql", { "ss-dbg-expanded": w(t.id) }]),
|
|
77
|
-
role: "button",
|
|
78
|
-
tabindex: "0",
|
|
79
|
-
onClick: (T) => g(t.id),
|
|
80
|
-
onKeydown: A((T) => g(t.id), ["enter"])
|
|
81
|
-
}, a(t.sql), 43, X),
|
|
82
|
-
p.value[t.sql] > 1 ? (l(), n("span", j, " x" + a(p.value[t.sql]), 1)) : f("", !0),
|
|
83
|
-
t.inTransaction ? (l(), n("span", G, " TXN")) : f("", !0)
|
|
84
|
-
]),
|
|
85
|
-
e("td", {
|
|
86
|
-
class: h(["ss-dbg-duration", k(t.duration)])
|
|
87
|
-
}, a(v(y)(t.duration)), 3),
|
|
88
|
-
e("td", null, [
|
|
89
|
-
e("span", {
|
|
90
|
-
class: h(`ss-dbg-method ss-dbg-method-${t.method.toLowerCase()}`)
|
|
91
|
-
}, a(t.method), 3)
|
|
92
|
-
]),
|
|
93
|
-
e("td", H, a(t.model || "-"), 1),
|
|
94
|
-
e("td", {
|
|
95
|
-
class: "ss-dbg-event-time",
|
|
96
|
-
title: v(R)(t.timestamp)
|
|
97
|
-
}, a(v(V)(t.timestamp)), 9, J)
|
|
98
|
-
]))), 128))
|
|
99
|
-
])
|
|
100
|
-
], 512))
|
|
101
|
-
]));
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
export {
|
|
105
|
-
Z as default
|
|
106
|
-
};
|