1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

fetch average runtime as double, not int

only makes a difference for very short jobs, but nice
to have more accurate graphs
This commit is contained in:
Oliver Giles 2020-12-05 13:51:25 +13:00
parent e442652e0a
commit c274e321df

View File

@ -427,7 +427,7 @@ std::string Laminar::getStatus(MonitorScope scope) {
j.startObject("timePerJob");
db->stmt("SELECT name, AVG(completedAt-startedAt) av FROM builds WHERE completedAt > ? GROUP BY name ORDER BY av DESC LIMIT 8")
.bind(time(nullptr) - 7 * 86400)
.fetch<str, uint>([&](str job, uint time){
.fetch<str, double>([&](str job, double time){
j.set(job.c_str(), time);
});
j.EndObject();