From 8c24638ff193efd472886e1e83325326e430eca4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 15 Nov 2013 14:26:38 +0100 Subject: [PATCH] Fix latency calculation. Refs #5050 --- lib/icinga/service-check.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 796a2bc94..972bb598b 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -459,6 +459,7 @@ void Service::ExecuteCheck(void) } /* keep track of scheduling info in case the check type doesn't provide its own information */ + double scheduled_start = GetNextCheck(); double before_check = Utility::GetTime(); Service::Ptr self = GetSelf(); @@ -490,16 +491,16 @@ void Service::ExecuteCheck(void) double after_check = Utility::GetTime(); if (result) { - if (!result->GetScheduleStart() == 0) - result->SetScheduleStart(before_check); + if (result->GetScheduleStart() == 0) + result->SetScheduleStart(scheduled_start); - if (!result->GetScheduleEnd() == 0) + if (result->GetScheduleEnd() == 0) result->SetScheduleEnd(after_check); - if (!result->GetExecutionStart() == 0) + if (result->GetExecutionStart() == 0) result->SetExecutionStart(before_check); - if (!result->GetExecutionEnd() == 0) + if (result->GetExecutionEnd() == 0) result->SetExecutionEnd(after_check); } -- 2.40.0