Mads
Multi-Agent Distributed System
Loading...
Searching...
No Matches
Mads::ClockOffsetResult Struct Reference

Result of a clock-offset measurement: offset_us added to a clock in the measured domain yields broker-host time (broker_host_clock - domain_clock). source/hops/origin_agent_id/seq are Agent-level bookkeeping the estimator does not fill in – only estimate()'s own offset_us/delay_us/samples/valid are computed from the timestamps. More...

#include <clock_offset.hpp>

Public Member Functions

std::string clock_ref () const
 

Public Attributes

int64_t offset_us = 0
 
int64_t delay_us = 0
 
int64_t jitter_us = 0
 
size_t samples = 0
 
uint8_t hops = 0
 
ClockSource source = ClockSource::None
 
std::string origin_agent_id
 
uint64_t seq = 0
 
std::chrono::steady_clock::time_point measured_at {}
 
bool valid = false
 

Detailed Description

Result of a clock-offset measurement: offset_us added to a clock in the measured domain yields broker-host time (broker_host_clock - domain_clock). source/hops/origin_agent_id/seq are Agent-level bookkeeping the estimator does not fill in – only estimate()'s own offset_us/delay_us/samples/valid are computed from the timestamps.

Examples
/home/runner/work/MADS/MADS/src/agent.hpp.

Definition at line 51 of file clock_offset.hpp.

Member Function Documentation

◆ clock_ref()

std::string Mads::ClockOffsetResult::clock_ref ( ) const
inline

"<origin_agent_id>:<seq>", stamped onto corrected payloads so two agents can be proven to have used the same offset.

Definition at line 72 of file clock_offset.hpp.

References origin_agent_id, and seq.

Member Data Documentation

◆ delay_us

int64_t Mads::ClockOffsetResult::delay_us = 0

Definition at line 53 of file clock_offset.hpp.

◆ hops

uint8_t Mads::ClockOffsetResult::hops = 0

0 = measured directly against the broker; >0 = chained through that many peer hops (a "peer"-source measurement composed on top of another agent's own adopted offset).

Definition at line 59 of file clock_offset.hpp.

◆ jitter_us

int64_t Mads::ClockOffsetResult::jitter_us = 0

Definition at line 54 of file clock_offset.hpp.

◆ measured_at

std::chrono::steady_clock::time_point Mads::ClockOffsetResult::measured_at {}

Local reception/measurement instant (steady_clock), used only for staleness – never compared across hosts.

Definition at line 67 of file clock_offset.hpp.

◆ offset_us

int64_t Mads::ClockOffsetResult::offset_us = 0

Definition at line 52 of file clock_offset.hpp.

◆ origin_agent_id

std::string Mads::ClockOffsetResult::origin_agent_id

Which agent's measurement this is – the tie-breaker and identity used by ClockConsensus's adoption rule.

Definition at line 63 of file clock_offset.hpp.

Referenced by clock_ref().

◆ samples

size_t Mads::ClockOffsetResult::samples = 0

Definition at line 55 of file clock_offset.hpp.

◆ seq

uint64_t Mads::ClockOffsetResult::seq = 0

Definition at line 64 of file clock_offset.hpp.

Referenced by clock_ref().

◆ source

ClockSource Mads::ClockOffsetResult::source = ClockSource::None

Definition at line 60 of file clock_offset.hpp.

◆ valid

bool Mads::ClockOffsetResult::valid = false

Definition at line 68 of file clock_offset.hpp.


The documentation for this struct was generated from the following file: