pleroma_healthcheck: Avoid div by 0

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-04-20 18:57:27 +02:00
parent b448f0fcb1
commit 63f106a250

View File

@ -153,8 +153,12 @@ if ($response->is_success) {
print "job_queue_", $k, "_success.min 0\n";
print "job_queue_", $k, "_success.max 100\n";
} else {
if ($v->{'processed_jobs'} == 0) {
print "job_queue_", $k, "_success.value 0\n";
} else
print "job_queue_", $k, "_success.value ", ($v->{'success'}/$v->{'processed_jobs'})*100, "\n";
}
}
#print "job_queue_", $k, "_failed.label job queue ", $k, " failure%\n";
#print "job_queue_", $k, "_failed.min 0\n";