Skip to content

Commit 110fc1c

Browse files
committed
Built in dashboard widgets added
1 parent 4b82df8 commit 110fc1c

File tree

1 file changed

+183
-55
lines changed

1 file changed

+183
-55
lines changed

apps/webapp/app/presenters/v3/BuiltInDashboards.server.ts

Lines changed: 183 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -7,80 +7,208 @@ const overviewDashboard: BuiltInDashboard = {
77
layout: {
88
version: "1",
99
layout: [
10-
{ i: "a", x: 0, y: 0, w: 6, h: 20 },
11-
{ i: "b", x: 6, y: 0, w: 6, h: 20 },
12-
{ i: "c", x: 0, y: 20, w: 12, h: 20 },
10+
{ i: "9lDDdebQ", x: 3, y: 0, w: 3, h: 4 },
11+
{ i: "VhAgNlB0", x: 0, y: 0, w: 3, h: 4 },
12+
{ i: "iI5EnhJW", x: 6, y: 0, w: 3, h: 4 },
13+
{ i: "HtSgJEmp", x: 0, y: 17, w: 12, h: 2, minH: 2, maxH: 2 },
14+
{ i: "rRbzv-Aq", x: 6, y: 4, w: 6, h: 13 },
15+
{ i: "j3yFSxLM", x: 0, y: 33, w: 6, h: 11 },
16+
{ i: "IKB8cENo", x: 6, y: 33, w: 6, h: 11 },
17+
{ i: "-fHz3CyQ", x: 0, y: 56, w: 12, h: 2, minH: 2, maxH: 2 },
18+
{ i: "hnKsN482", x: 0, y: 58, w: 12, h: 15 },
19+
{ i: "if6dds8T", x: 0, y: 19, w: 12, h: 14 },
20+
{ i: "i3q1Awfz", x: 0, y: 4, w: 6, h: 13 },
21+
{ i: "Kh0w0fjy", x: 6, y: 44, w: 6, h: 12 },
22+
{ i: "zybRTAdz", x: 0, y: 44, w: 6, h: 12 },
23+
{ i: "ff2nVxxt", x: 0, y: 73, w: 12, h: 15 },
24+
{ i: "Dib0ywb4", x: 0, y: 88, w: 12, h: 2, minH: 2, maxH: 2 },
25+
{ i: "YsWiQENd", x: 0, y: 90, w: 12, h: 15 },
26+
{ i: "lc-guCvo", x: 0, y: 105, w: 12, h: 15 },
27+
{ i: "xyQl3FAd", x: 9, y: 0, w: 3, h: 4 },
1328
],
1429
widgets: {
15-
a: {
16-
title: "Runs by status",
17-
query: `SELECT
18-
toStartOfHour(triggered_at) AS HOUR,
19-
status,
20-
count() AS run_count
21-
FROM
22-
runs
23-
GROUP BY
24-
HOUR,
25-
status
26-
ORDER BY
27-
HOUR DESC
28-
LIMIT
29-
100`,
30+
"9lDDdebQ": {
31+
title: "Total runs",
32+
query: "SELECT\r\n count() AS total_runs\r\nFROM\r\n runs\r\nLIMIT\r\n 100",
33+
display: { type: "bignumber", column: "total_runs", aggregation: "sum", abbreviate: false },
34+
},
35+
VhAgNlB0: {
36+
title: "Success %",
37+
query:
38+
"SELECT\r\n round(countIf (status = 'Completed') * 100.0 / countIf (is_finished = 1), 2) AS success_percentage\r\nFROM\r\n runs\r\nLIMIT\r\n 100",
3039
display: {
31-
type: "table",
32-
prettyFormatting: true,
33-
sorting: [],
40+
type: "bignumber",
41+
column: "success_percentage",
42+
aggregation: "sum",
43+
abbreviate: true,
44+
suffix: "%",
3445
},
3546
},
36-
b: {
47+
iI5EnhJW: {
48+
title: "Failed runs",
49+
query:
50+
"SELECT\r\n count() AS total_runs\r\nFROM\r\n runs\r\nWHERE status IN ('Failed', 'System failure', 'Crashed')\r\nLIMIT\r\n 100",
51+
display: { type: "bignumber", column: "total_runs", aggregation: "sum", abbreviate: false },
52+
},
53+
HtSgJEmp: { title: "Failed runs", query: "", display: { type: "title" } },
54+
"rRbzv-Aq": {
3755
title: "Runs by status",
38-
query: `SELECT
39-
toStartOfHour(triggered_at) AS HOUR,
40-
status,
41-
count() AS run_count
42-
FROM
43-
runs
44-
GROUP BY
45-
HOUR,
46-
status
47-
ORDER BY
48-
HOUR DESC
49-
LIMIT
50-
100`,
56+
query:
57+
"SELECT\r\n timeBucket (),\r\n status,\r\n count() AS run_count\r\nFROM\r\n runs\r\nGROUP BY\r\n timeBucket,\r\n status\r\nORDER BY\r\n timeBucket\r\nLIMIT\r\n 100",
5158
display: {
5259
type: "chart",
5360
chartType: "bar",
54-
xAxisColumn: "HOUR",
61+
xAxisColumn: "timebucket",
5562
yAxisColumns: ["run_count"],
5663
groupByColumn: "status",
5764
stacked: true,
65+
sortByColumn: null,
66+
sortDirection: "asc",
5867
aggregation: "sum",
68+
},
69+
},
70+
j3yFSxLM: {
71+
title: "Top failing tasks",
72+
query:
73+
"SELECT\r\n task_identifier AS task,\r\n count() AS runs,\r\n countIf (status IN ('Failed', 'Crashed', 'System failure')) AS failures,\r\n concat(round((countIf (status IN ('Failed', 'Crashed', 'System failure')) / count()) * 100, 2), '%') AS failure_rate,\r\n avg(attempt_count - 1) AS avg_retries\r\nFROM\r\n runs\r\nGROUP BY\r\n task_identifier\r\nORDER BY\r\n (countIf (status IN ('Failed', 'Crashed', 'System failure')) / count()) DESC\r\nLIMIT\r\n 100;",
74+
display: { type: "table", prettyFormatting: true, sorting: [] },
75+
},
76+
IKB8cENo: {
77+
title: "Top failing tags",
78+
query:
79+
"SELECT\r\n arrayJoin(tags) AS tag,\r\n count() AS runs,\r\n countIf (status IN ('Failed', 'Crashed', 'System failure')) AS failures,\r\n concat(round((countIf (status IN ('Failed', 'Crashed', 'System failure')) / count()) * 100, 2), '%') AS failure_rate,\r\n avg(attempt_count - 1) AS avg_retries\r\nFROM\r\n runs\r\nGROUP BY\r\n tag\r\nORDER BY\r\n (countIf (status IN ('Failed', 'Crashed', 'System failure')) / count()) DESC\r\nLIMIT\r\n 100;",
80+
display: { type: "table", prettyFormatting: true, sorting: [] },
81+
},
82+
"-fHz3CyQ": { title: "Usage and cost", query: "", display: { type: "title" } },
83+
hnKsN482: {
84+
title: "Cost by task",
85+
query:
86+
"SELECT\r\n timeBucket() as time_period,\r\n task_identifier,\r\n sum(total_cost) AS total_cost\r\nFROM\r\n runs\r\nGROUP BY\r\n time_period,\r\n task_identifier\r\nORDER BY\r\n time_period\r\nLIMIT\r\n 100",
87+
display: {
88+
type: "chart",
89+
chartType: "line",
90+
xAxisColumn: "time_period",
91+
yAxisColumns: ["total_cost"],
92+
groupByColumn: "task_identifier",
93+
stacked: true,
94+
sortByColumn: null,
5995
sortDirection: "asc",
60-
sortByColumn: "HOUR",
96+
aggregation: "sum",
6197
},
6298
},
63-
c: {
64-
title: "Runs by status",
65-
query: `SELECT
66-
toStartOfHour(triggered_at) AS HOUR,
67-
status,
68-
count() AS run_count
69-
FROM
70-
runs
71-
GROUP BY
72-
HOUR,
73-
status
74-
ORDER BY
75-
HOUR DESC
76-
LIMIT
77-
100`,
99+
if6dds8T: {
100+
title: "Failed runs by task",
101+
query:
102+
"SELECT\r\n timeBucket () as time_period,\r\n task_identifier,\r\n count() AS run_count\r\nFROM\r\n runs\r\nWHERE status IN ('Failed', 'Crashed', 'System failure')\r\nGROUP BY\r\n time_period,\r\n task_identifier\r\nORDER BY\r\n time_period\r\nLIMIT\r\n 100",
78103
display: {
79-
type: "table",
80-
prettyFormatting: true,
81-
sorting: [],
104+
type: "chart",
105+
chartType: "bar",
106+
xAxisColumn: "time_period",
107+
yAxisColumns: ["run_count"],
108+
groupByColumn: "task_identifier",
109+
stacked: true,
110+
sortByColumn: null,
111+
sortDirection: "asc",
112+
aggregation: "sum",
113+
},
114+
},
115+
i3q1Awfz: {
116+
title: "Run success",
117+
query:
118+
"SELECT\r\n timeBucket (),\r\n count() as total,\r\n countIf (status = 'Completed') / total * 100 AS completed,\r\n countIf (status IN ('Failed', 'Crashed', 'System failure')) / total * 100 AS failed,\r\nFROM\r\n runs\r\nGROUP BY\r\n timeBucket\r\nORDER BY\r\n timeBucket",
119+
display: {
120+
type: "chart",
121+
chartType: "line",
122+
xAxisColumn: "timebucket",
123+
yAxisColumns: ["failed", "completed"],
124+
groupByColumn: null,
125+
stacked: false,
126+
sortByColumn: null,
127+
sortDirection: "asc",
128+
aggregation: "sum",
129+
seriesColors: { failed: "#f43f5e" },
82130
},
83131
},
132+
Kh0w0fjy: {
133+
title: "Top errors",
134+
query:
135+
"SELECT\r\n concat(error.name, '(\"', error.message, '\")') AS error,\r\n count() AS count\r\nFROM\r\n runs\r\nWHERE\r\n runs.error != NULL\r\n AND runs.error.name != NULL\r\nGROUP BY\r\n error\r\nORDER BY\r\n count DESC\r\nLIMIT\r\n 100",
136+
display: { type: "table", prettyFormatting: true, sorting: [] },
137+
},
138+
zybRTAdz: {
139+
title: "Top errors over time",
140+
query:
141+
"SELECT\r\n timeBucket(),\r\n concat(error.name, '(\"', error.message, '\")') AS error,\r\n count() AS count\r\nFROM\r\n runs\r\nWHERE\r\n runs.error != NULL\r\n AND runs.error.name != NULL\r\nGROUP BY\r\n timeBucket,\r\n error\r\nORDER BY\r\n count DESC\r\nLIMIT\r\n 100",
142+
display: {
143+
type: "chart",
144+
chartType: "bar",
145+
xAxisColumn: "timebucket",
146+
yAxisColumns: ["count"],
147+
groupByColumn: "error",
148+
stacked: true,
149+
sortByColumn: null,
150+
sortDirection: "asc",
151+
aggregation: "sum",
152+
seriesColors: { count: "#ef4343" },
153+
},
154+
},
155+
ff2nVxxt: {
156+
title: "Cost by machine",
157+
query:
158+
"SELECT\r\n timeBucket() as time_period,\r\n machine,\r\n sum(total_cost) AS total_cost\r\nFROM\r\n runs\r\nWHERE machine != ''\r\nGROUP BY\r\n time_period,\r\n machine\r\nORDER BY\r\n time_period\r\nLIMIT\r\n 100",
159+
display: {
160+
type: "chart",
161+
chartType: "line",
162+
xAxisColumn: "time_period",
163+
yAxisColumns: ["total_cost"],
164+
groupByColumn: "machine",
165+
stacked: true,
166+
sortByColumn: null,
167+
sortDirection: "asc",
168+
aggregation: "sum",
169+
},
170+
},
171+
Dib0ywb4: { title: "Versions", query: "", display: { type: "title" } },
172+
YsWiQENd: {
173+
title: "Runs by version",
174+
query:
175+
"SELECT\r\n timeBucket (),\r\n task_version,\r\n count() as runs\r\nFROM\r\n runs\r\nWHERE task_version != ''\r\nGROUP BY\r\n timeBucket,\r\n task_version\r\nORDER BY\r\n timeBucket",
176+
display: {
177+
type: "chart",
178+
chartType: "line",
179+
xAxisColumn: "timebucket",
180+
yAxisColumns: ["runs"],
181+
groupByColumn: "task_version",
182+
stacked: false,
183+
sortByColumn: null,
184+
sortDirection: "asc",
185+
aggregation: "sum",
186+
seriesColors: {},
187+
},
188+
},
189+
"lc-guCvo": {
190+
title: "Version success %",
191+
query:
192+
"SELECT\r\n timeBucket (),\r\n task_version,\r\n count() as total,\r\n countIf (status = 'Completed') / total * 100 AS success\r\nFROM\r\n runs\r\nWHERE task_version != ''\r\nGROUP BY\r\n timeBucket,\r\n task_version\r\nORDER BY\r\n timeBucket",
193+
display: {
194+
type: "chart",
195+
chartType: "line",
196+
xAxisColumn: "timebucket",
197+
yAxisColumns: ["success"],
198+
groupByColumn: "task_version",
199+
stacked: false,
200+
sortByColumn: null,
201+
sortDirection: "asc",
202+
aggregation: "sum",
203+
seriesColors: {},
204+
},
205+
},
206+
xyQl3FAd: {
207+
title: "Queued",
208+
query:
209+
"SELECT\r\n count() AS queued\r\nFROM\r\n runs\r\nWHERE status IN ('Dequeued', 'Queued')\r\nLIMIT\r\n 100",
210+
display: { type: "bignumber", column: "queued", aggregation: "sum", abbreviate: false },
211+
},
84212
},
85213
},
86214
};

0 commit comments

Comments
 (0)