feat: add duration display

This commit is contained in:
BennyKok
2024-01-20 17:46:15 +08:00
parent 1a0d73ff8b
commit c98a16a2dd
6 changed files with 39 additions and 11 deletions
+4
View File
@@ -23,6 +23,10 @@ export async function findAllRuns({
extras: {
number: sql<number>`row_number() over (order by created_at)`.as("number"),
total: sql<number>`count(*) over ()`.as("total"),
duration:
sql<number>`(extract(epoch from ended_at) - extract(epoch from created_at))`.as(
"duration"
),
},
with: {
machine: {