[icinga-checkins] icinga.org: icinga2/feature/fiber-test: Fix latency calculation.

git at icinga.org git at icinga.org
Fri Nov 15 22:45:12 CET 2013


Module: icinga2
Branch: feature/fiber-test
Commit: 8c24638ff193efd472886e1e83325326e430eca4
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=8c24638ff193efd472886e1e83325326e430eca4

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Nov 15 14:26:38 2013 +0100

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 796a2bc..972bb59 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);
 	}
 





More information about the icinga-checkins mailing list