|
VLink
2.0.0
A high-performance communication middleware
|
Per-publisher gap detection used to expose sample loss statistics to subscribers. More...
Go to the source code of this file.
Classes | |
| class | vlink::CalculateSample |
| Tracks expected and lost sample counts grouped by sender GUID. More... | |
Namespaces | |
| vlink | |
Per-publisher gap detection used to expose sample loss statistics to subscribers.
This is an internal implementation header used by the public subscriber / getter templates and their backend NodeImpl classes; it is not part of the user API. CalculateSample inspects the monotonic sequence numbers attached to incoming frames and accumulates how many samples have been expected and how many have been skipped, on a per-sender basis.
| Caller | What it does with CalculateSample |
|---|---|
SubscriberImpl / GetterImpl | Owns one instance when latency tracking is on. |
| Transport backend receive thread | Calls update(seq, guid) for every frame. |
get_lost() / proxy / discovery layer | Reads cumulative counters for reporting. |
uint64_t values, and the table is guarded by a std::shared_mutex so reads from multiple reader threads do not contend with each other.first with the observed sequence number and expected with seq + 1, and records zero loss.expected by one.seq is ahead of expected by at most UINT32_MAX, the gap is added to lost and expected jumps to seq + 1.UINT32_MAX is treated as a sender restart and the state is re-seeded with no extra loss recorded.get_total() returns the sum of (expected - first) across all GUIDs; get_lost() returns the sum of lost counters.