From a4466ba8802cac48af174c3a8302b59383151034 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 10 Jan 2014 00:38:16 +0100 Subject: [PATCH] Fix formatting of execution_time, latency. Fixes #5427 --- components/compat/statusdatawriter.cpp | 4 ++-- lib/db_ido/hostdbobject.cpp | 4 ++-- lib/db_ido/servicedbobject.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/compat/statusdatawriter.cpp b/components/compat/statusdatawriter.cpp index 8a0019933..6d812efb2 100644 --- a/components/compat/statusdatawriter.cpp +++ b/components/compat/statusdatawriter.cpp @@ -321,8 +321,8 @@ void StatusDataWriter::DumpServiceStatusAttrs(std::ostream& fp, const Service::P "\t" "should_be_scheduled=" << CompatUtility::GetServiceShouldBeScheduled(service) << "\n"; if (cr) { - fp << "\t" << "check_execution_time=" << static_cast(Service::CalculateExecutionTime(cr)) << "\n" - "\t" "check_latency=" << static_cast(Service::CalculateLatency(cr)) << "\n"; + fp << "\t" << "check_execution_time=" << Convert::ToString(Service::CalculateExecutionTime(cr)) << "\n" + "\t" "check_latency=" << Convert::ToString(Service::CalculateLatency(cr)) << "\n"; } fp << "\t" << "current_state=" << CompatUtility::GetServiceCurrentState(service) << "\n" diff --git a/lib/db_ido/hostdbobject.cpp b/lib/db_ido/hostdbobject.cpp index 28e128e19..9cd68dad0 100644 --- a/lib/db_ido/hostdbobject.cpp +++ b/lib/db_ido/hostdbobject.cpp @@ -175,8 +175,8 @@ Dictionary::Ptr HostDbObject::GetStatusFields(void) const fields->Set("percent_state_change", CompatUtility::GetServicePercentStateChange(service)); if (cr) { - fields->Set("latency", Service::CalculateLatency(cr)); - fields->Set("execution_time", Service::CalculateExecutionTime(cr)); + fields->Set("latency", Convert::ToString(Service::CalculateLatency(cr))); + fields->Set("execution_time", Convert::ToString(Service::CalculateExecutionTime(cr))); } fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth()); fields->Set("failure_prediction_enabled", Empty); diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index c2a3cf09d..d7b75e168 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -179,8 +179,8 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields(void) const fields->Set("percent_state_change", CompatUtility::GetServicePercentStateChange(service)); if (cr) { - fields->Set("latency", Service::CalculateLatency(cr)); - fields->Set("execution_time", Service::CalculateExecutionTime(cr)); + fields->Set("latency", Convert::ToString(Service::CalculateLatency(cr))); + fields->Set("execution_time", Convert::ToString(Service::CalculateExecutionTime(cr))); } fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth()); @@ -1276,8 +1276,8 @@ void ServiceDbObject::AddServiceCheckHistory(const Service::Ptr& service, const fields1->Set("command_object_id", service->GetCheckCommand()); fields1->Set("command_args", Empty); fields1->Set("command_line", cr->GetCommand()); - fields1->Set("execution_time", execution_time); - fields1->Set("latency", Service::CalculateLatency(cr)); + fields1->Set("execution_time", Convert::ToString(execution_time)); + fields1->Set("latency", Convert::ToString(Service::CalculateLatency(cr))); fields1->Set("return_code", cr->GetExitStatus()); fields1->Set("output", CompatUtility::GetCheckResultOutput(cr)); fields1->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));