Merge pull request #9599 from Icinga/influx-ns

Influx DB: don't unneccessarily truncate timestamps to whole seconds
This commit is contained in:
Julian Brost 2023-01-26 17:44:50 +01:00 committed by GitHub
commit ad8868cab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -37,6 +37,7 @@
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/regex.hpp>
#include <boost/scoped_array.hpp>
#include <iomanip>
#include <memory>
#include <string>
#include <utility>
@ -398,7 +399,7 @@ void InfluxdbCommonWriter::SendMetric(const Checkable::Ptr& checkable, const Dic
}
}
msgbuf << " " << static_cast<unsigned long>(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,6 @@ Url::Ptr InfluxdbCommonWriter::AssembleBaseUrl()
url->SetScheme(GetSslEnable() ? "https" : "http");
url->SetHost(GetHost());
url->SetPort(GetPort());
url->AddQueryElement("precision", "s");
return url;
}