Skip to content

Commit

Permalink
Merge pull request #9599 from Icinga/influx-ns
Browse files Browse the repository at this point in the history
Influx DB: don't unneccessarily truncate timestamps to whole seconds
  • Loading branch information
julianbrost authored Jan 26, 2023
2 parents 27af882 + 21f548d commit ad8868c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/perfdata/influxdbcommonwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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() << "'.";
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit ad8868c

Please sign in to comment.