]> granicus.if.org Git - icinga2/commitdiff
Fix formatting of execution_time, latency.
authorMichael Friedrich <Michael.Friedrich@netways.de>
Thu, 9 Jan 2014 23:38:16 +0000 (00:38 +0100)
committerMichael Friedrich <Michael.Friedrich@netways.de>
Thu, 9 Jan 2014 23:38:16 +0000 (00:38 +0100)
Fixes #5427

components/compat/statusdatawriter.cpp
lib/db_ido/hostdbobject.cpp
lib/db_ido/servicedbobject.cpp

index 8a0019933b554be02d2ee6def88bf6f75a523f51..6d812efb2597112044150e651dd7f1f7b8c25b05 100644 (file)
@@ -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<double>(Service::CalculateExecutionTime(cr)) << "\n"
-                "\t" "check_latency=" << static_cast<double>(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"
index 28e128e1958b12c29da45b341b2f0307455c1762..9cd68dad0c9b39e983d26163d0755845fc04f17d 100644 (file)
@@ -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);
index c2a3cf09d33d2afdd431f36f1798d63abf83e889..d7b75e168d079b6e6e73cda180a8e3224a634980 100644 (file)
@@ -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));