Ensure that execution_time never goes below 0

This commit is contained in:
Noah Hilverling 2019-10-31 13:59:16 +01:00 committed by Michael Friedrich
parent 4e43c766ca
commit 91ecfc35cf
1 changed files with 1 additions and 1 deletions

View File

@ -1616,7 +1616,7 @@ Dictionary::Ptr IcingaDB::SerializeState(const Checkable::Ptr& checkable)
if (!cr->GetCommand().IsEmpty())
attrs->Set("commandline", FormatCommandLine(cr->GetCommand()));
attrs->Set("execution_time", TimestampToMilliseconds(cr->CalculateExecutionTime()));
attrs->Set("execution_time", TimestampToMilliseconds(fmax(0.0, cr->CalculateExecutionTime())));
attrs->Set("latency", TimestampToMilliseconds(cr->CalculateLatency()));
attrs->Set("check_source", cr->GetCheckSource());
}