diff --git a/lib/perfdata/influxdbcommonwriter.cpp b/lib/perfdata/influxdbcommonwriter.cpp index a42d9e182..fd588a178 100644 --- a/lib/perfdata/influxdbcommonwriter.cpp +++ b/lib/perfdata/influxdbcommonwriter.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -398,7 +399,7 @@ void InfluxdbCommonWriter::SendMetric(const Checkable::Ptr& checkable, const Dic } } - msgbuf << " " << static_cast(ts); + msgbuf << " " << std::fixed << std::setprecision(0) << ts * 1.0e9; Log(LogDebug, GetReflectionType()->GetName()) << "Checkable '" << checkable->GetName() << "' adds to metric list:'" << msgbuf.str() << "'."; @@ -553,7 +554,7 @@ Url::Ptr InfluxdbCommonWriter::AssembleBaseUrl() url->SetScheme(GetSslEnable() ? "https" : "http"); url->SetHost(GetHost()); url->SetPort(GetPort()); - url->AddQueryElement("precision", "s"); + url->AddQueryElement("precision", "ns"); return url; }