Skip to content
Snippets Groups Projects
Commit 746eeca4 authored by Utz-Uwe Haus's avatar Utz-Uwe Haus
Browse files

Add ctime to translated events, populate from Pool Events

parent a7f846b6
Branches 78-add-origin-timestamp-to-events
Tags
2 merge requests!32Draft: Resolve "cmake integration issues",!31Resolve "Add origin timestamp to events"
Pipeline #78824 passed
...@@ -387,6 +387,7 @@ mstro_subscribe(mstro_cdo_selector cdos, mstro_pool_event_kinds events, ...@@ -387,6 +387,7 @@ mstro_subscribe(mstro_cdo_selector cdos, mstro_pool_event_kinds events,
struct mstro_pool_event_ { struct mstro_pool_event_ {
enum mstro_pool_event_kind kind; /**< the event kind */ enum mstro_pool_event_kind kind; /**< the event kind */
uint64_t serial; /**< the event identifier */ uint64_t serial; /**< the event identifier */
mstro_nanosec_t ctime; /**< the time the event was created at the source */
union { union {
/* for DECLARE events */ /* for DECLARE events */
struct { struct {
......
...@@ -1863,6 +1863,10 @@ mstro_pool_event_consume(const Mstro__Pool__Event *eventmsg) ...@@ -1863,6 +1863,10 @@ mstro_pool_event_consume(const Mstro__Pool__Event *eventmsg)
eventmsg->kind, ev->kind, mstro_pool_event_description(ev->kind)); eventmsg->kind, ev->kind, mstro_pool_event_description(ev->kind));
ev->serial = eventmsg->serial; ev->serial = eventmsg->serial;
assert(eventmsg->ctime!=NULL);
ev->ctime = (eventmsg->ctime->sec * NSEC_PER_SEC) + eventmsg->ctime->nsec;
switch(ev->kind) { switch(ev->kind) {
case MSTRO_POOL_EVENT_APP_JOIN: case MSTRO_POOL_EVENT_APP_JOIN:
assert(eventmsg->payload_case==MSTRO__POOL__EVENT__PAYLOAD_JOIN); assert(eventmsg->payload_case==MSTRO__POOL__EVENT__PAYLOAD_JOIN);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment