mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-10-17 08:40:54 +00:00
resolves #62: add average line to build time graphs
This commit is contained in:
@@ -229,9 +229,10 @@ void Laminar::sendStatus(LaminarClient* client) {
|
||||
.EndObject();
|
||||
});
|
||||
j.EndArray();
|
||||
db->stmt("SELECT COUNT(*) FROM builds WHERE name = ?")
|
||||
db->stmt("SELECT COUNT(*),AVG(completedAt-startedAt) FROM builds WHERE name = ?")
|
||||
.bind(client->scope.job)
|
||||
.fetch<uint>([&](uint nRuns){
|
||||
.fetch<uint,uint>([&](uint nRuns, uint averageRuntime){
|
||||
j.set("averageRuntime", averageRuntime);
|
||||
j.set("pages", (nRuns-1) / runsPerPage + 1);
|
||||
j.startObject("sort");
|
||||
j.set("page", client->scope.page)
|
||||
|
||||
Reference in New Issue
Block a user