1
0
mirror of https://github.com/Icinga/icinga2.git synced 2025-04-08 17:05:25 +02:00

Make sure the check latency can't be negative.

This commit is contained in:
Gunnar Beutner 2013-09-12 11:36:31 +02:00
parent eb20b7e33e
commit f418db79d7

@ -837,5 +837,10 @@ double Service::CalculateLatency(const Dictionary::Ptr& cr)
schedule_end = cr->Get("schedule_end");
}
return (schedule_end - schedule_start) - CalculateExecutionTime(cr);
double latency = (schedule_end - schedule_start) - CalculateExecutionTime(cr);
if (latency < 0)
latency = 0;
return latency;
}