QtCraft API C++ classes QML types Handbook

QcRoundTripStats Class

Round trip samples of the last windowNs (decision E-886). More...

Header: #include <common/diagnostics/QcRoundTripStats.h>

Public Functions

void add(qint64 atNs, qint64 roundTripNs)
std::optional<QcRoundTripSummary> summary(qint64 nowNs) const

Static Public Members

const qint64 defaultWindowNs
const double smoothing

Detailed Description

Plain data for one thread; whoever shares it guards it (QcLatencyProbe).

Member Function Documentation

void QcRoundTripStats::add(qint64 atNs, qint64 roundTripNs)

A round trip of roundTripNs that ended at atNs (a steady clock).

std::optional<QcRoundTripSummary> QcRoundTripStats::summary(qint64 nowNs) const

Returns the window as it is at nowNs; std::nullopt before the first sample. The smoothed value and the latest sample stay when the window has run empty.

Member Variable Documentation

const qint64 QcRoundTripStats::defaultWindowNs

The window's default length: ten seconds.

const double QcRoundTripStats::smoothing

Weight of a new sample in the smoothed value.