VLink  2.0.0
A high-performance communication middleware
vlink::CalculateSample类 参考final

Tracks expected and lost sample counts grouped by sender GUID. 更多...

#include <calculate_sample.h>

vlink::CalculateSample 的协作图:

Public 成员函数

 CalculateSample () noexcept
 Constructs an empty counter. 更多...
 
 ~CalculateSample () noexcept
 Releases all per-sender state. 更多...
 
void update (uint64_t seq, uint64_t guid=0) noexcept
 Records a sequence number received from guid. 更多...
 
uint64_t get_total () const noexcept
 Returns the total number of expected samples across all senders. 更多...
 
uint64_t get_lost () const noexcept
 Returns the cumulative number of lost samples across all senders. 更多...
 

详细描述

Tracks expected and lost sample counts grouped by sender GUID.

One instance is created per subscriber / getter when latency-and-loss tracking is enabled. The guid parameter of update() lets a single receiver account for multiple senders without their streams interfering.

构造及析构函数说明

◆ CalculateSample()

vlink::CalculateSample::CalculateSample ( )
noexcept

Constructs an empty counter.

◆ ~CalculateSample()

vlink::CalculateSample::~CalculateSample ( )
noexcept

Releases all per-sender state.

成员函数说明

◆ get_lost()

uint64_t vlink::CalculateSample::get_lost ( ) const
noexcept

Returns the cumulative number of lost samples across all senders.

返回
Aggregate loss count since construction.

◆ get_total()

uint64_t vlink::CalculateSample::get_total ( ) const
noexcept

Returns the total number of expected samples across all senders.

Computed as the sum of (expected - first) over every tracked GUID. The value includes both received and lost samples.

返回
Number of expected samples; 0 when no data has been observed yet.

◆ update()

void vlink::CalculateSample::update ( uint64_t  seq,
uint64_t  guid = 0 
)
noexcept

Records a sequence number received from guid.

Updates the per-sender counters according to the algorithm described at file scope. Acquires the exclusive side of the shared mutex.

参数
seqSequence number reported by the transport.
guidSender identifier; pass 0 when there is exactly one source.

该类的文档由以下文件生成: