diff --git a/src/laminar.cpp b/src/laminar.cpp index aec1950..713566d 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -333,14 +333,14 @@ void Laminar::sendStatus(LaminarClient* client) { } j.EndArray(); j.startObject("buildsPerJob"); - db->stmt("SELECT name, COUNT(*) FROM builds WHERE completedAt > ? GROUP BY name") + db->stmt("SELECT name, COUNT(*) c FROM builds WHERE completedAt > ? GROUP BY name ORDER BY c DESC LIMIT 5") .bind(time(nullptr) - 86400) .fetch([&](str job, int count){ j.set(job.c_str(), count); }); j.EndObject(); j.startObject("timePerJob"); - db->stmt("SELECT name, AVG(completedAt-startedAt) FROM builds WHERE completedAt > ? GROUP BY name") + db->stmt("SELECT name, AVG(completedAt-startedAt) av FROM builds WHERE completedAt > ? GROUP BY name ORDER BY av DESC LIMIT 5") .bind(time(nullptr) - 7 * 86400) .fetch([&](str job, uint time){ j.set(job.c_str(), time); diff --git a/src/resources/index.html b/src/resources/index.html index 0ed94f3..95905be 100644 --- a/src/resources/index.html +++ b/src/resources/index.html @@ -91,7 +91,7 @@
-
Total builds per day this week
+
Total runs per day this week
@@ -99,7 +99,7 @@
-
Builds per job in the last 24 hours
+
Most runs per job in the last 24 hours
@@ -107,7 +107,7 @@
-
Average build time per job this week
+
Longest average run time per job this week