Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
6027019d
Commit
6027019d
authored
Jul 15, 2019
by
Micha Müller
Browse files
Caliper patch: record timestamps with µs precision
parent
1124b762
Changes
2
Hide whitespace changes
Inline
Side-by-side
dcdbpusher/Caliper/patch
View file @
6027019d
...
...
@@ -8,3 +8,16 @@
add_subdirectory(debug)
add_subdirectory(env)
add_subdirectory(event)
--- a/src/services/timestamp/Timestamp.cpp
+++ b/src/services/timestamp/Timestamp.cpp
@@ -208,7 +208,8 @@
class Timestamp
if (record_timestamp && (scope & CALI_SCOPE_PROCESS))
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::duration_cast<chrono::microseconds>(chrono::system_clock::now().time_since_epoch()).count())));
}
void post_init_cb(Caliper* c, Channel* chn) {
dcdbpusher/sensors/caliper/CaliperSensorGroup.cpp
View file @
6027019d
...
...
@@ -166,11 +166,7 @@ void CaliperSensorGroup::read() {
reading_t
reading
;
reading
.
value
=
1
;
reading
.
timestamp
=
S_TO_NS
(
std
::
stoull
(
timestamp
));
//Caliper timestamps are seconds since UNIX epoch
//a timestamp with a precision of seconds is not unique enough --> append current nanoseconds
uint64_t
now_ns
=
getTimestamp
()
%
1000000000
;
reading
.
timestamp
+=
now_ns
;
reading
.
timestamp
=
US_TO_NS
(
std
::
stoull
(
timestamp
));
//Caliper timestamps are microseconds since UNIX epoch
S_Ptr
s
;
auto
it
=
_sensorIndex
.
find
(
feName
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment