Commit 488fdbf8 authored by Micha Müller's avatar Micha Müller
Browse files

Pusher: Caliper: Change timestamp precision to nanosec

parent 1a968c70
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
sbuf->append(timestamp_attr.id(), sbuf->append(timestamp_attr.id(),
- Variant(cali_make_variant_from_uint(chrono::system_clock::to_time_t(chrono::system_clock::now())))); - Variant(cali_make_variant_from_uint(chrono::system_clock::to_time_t(chrono::system_clock::now()))));
+ Variant(cali_make_variant_from_uint( + Variant(cali_make_variant_from_uint(
+ chrono::duration_cast<chrono::microseconds>(chrono::system_clock::now().time_since_epoch()).count()))); + chrono::duration_cast<chrono::nanoseconds>(chrono::system_clock::now().time_since_epoch()).count())));
} }
void post_init_cb(Caliper* c, Channel* chn) { void post_init_cb(Caliper* c, Channel* chn) {
...@@ -166,7 +166,7 @@ void CaliperSensorGroup::read() { ...@@ -166,7 +166,7 @@ void CaliperSensorGroup::read() {
reading_t reading; reading_t reading;
reading.value = 1; reading.value = 1;
reading.timestamp = US_TO_NS(std::stoull(timestamp)); //Caliper timestamps are microseconds since UNIX epoch reading.timestamp = std::stoull(timestamp);
S_Ptr s; S_Ptr s;
auto it = _sensorIndex.find(feName); auto it = _sensorIndex.find(feName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment