QtCraft API C++ classes QML types Handbook

QcAdminStatusRecorder Class

The status history of the admin channel (decision E-848): the durations of the ticks since the latest sample, and the samples of the last secondsKept seconds (one a second) and of the last minutesKept minutes (one a minute, the seconds of the minute folded by QcAdminSamples::folded: means of the means and rates, the highest p99 and maximum, the latest counts). More...

Header: #include <server/admin/QcAdminStatusRecorder.h>

Public Types

struct Counts

Public Functions

std::optional<QcMsg::AdminSample> latest() const
const QList<QcMsg::AdminSample> &minutes() const
void noteTick(double ms)
QcMsg::AdminSample sample(const QcAdminStatusRecorder::Counts &counts, double seconds)
const QList<QcMsg::AdminSample> &seconds() const

Static Public Members

const qsizetype minutesKept
const qsizetype secondsKept
const qsizetype ticksKept

Detailed Description

Recorded whether or not an operator looks, so a chart opened later shows the time before it. Cheap: one entry per tick, one sample a second.

Member Function Documentation

std::optional<QcMsg::AdminSample> QcAdminStatusRecorder::latest() const

Returns the latest sample; std::nullopt before the first second ended.

const QList<QcMsg::AdminSample> &QcAdminStatusRecorder::minutes() const

Returns the samples of the last minutesKept minutes, oldest first.

void QcAdminStatusRecorder::noteTick(double ms)

Notes a tick that took ms milliseconds (at most ticksKept between two samples are kept for the p99, all of them count for mean and maximum).

QcMsg::AdminSample QcAdminStatusRecorder::sample(const QcAdminStatusRecorder::Counts &counts, double seconds)

Ends the second that ran for seconds of real time and returns the sample of its ticks and counts, which is kept in the history.

const QList<QcMsg::AdminSample> &QcAdminStatusRecorder::seconds() const

Returns the samples of the last secondsKept seconds, oldest first.

Member Variable Documentation

const qsizetype QcAdminStatusRecorder::ticksKept

Tick durations kept between two samples; a sprint runs more, then mean and maximum still count all of them and the p99 looks at the first ones.