QtCraft API C++ classes QML types Handbook

QcStatsLog Class

The statistics log (decision E-225): every interval one line "STATS {json}" in the log (category qtcraft.stats), with the debug data as QcDebugJson writes it, so scripts and agents read the same numbers as the debug display. More...

Header: #include <clientcore/debug/QcStatsLog.h>
Inherits: QObject

Public Types

Source

Public Functions

int intervalMs() const

Signals

void logged(const QString &json)

Static Public Members

int interval(const QString &option)
const int maxIntervalMs
const int minIntervalMs

Detailed Description

Switched on with –stats <ms> or QTCRAFT_STATS=<ms>.

Member Type Documentation

[alias] QcStatsLog::Source

The data now; std::nullopt while there is none (no world), then nothing is logged.

Member Function Documentation

[static] int QcStatsLog::interval(const QString &option)

Returns the interval from the option value option or QTCRAFT_STATS ("" uses the variable): milliseconds, clamped to the limits; 0 when unset, not a number or not positive (log off).

int QcStatsLog::intervalMs() const

Returns the interval in milliseconds.

[signal] void QcStatsLog::logged(const QString &json)

Emitted with json, the line just logged, without the "STATS " prefix.

Member Variable Documentation

const int QcStatsLog::maxIntervalMs

Longest interval taken, in milliseconds.

const int QcStatsLog::minIntervalMs

Shortest interval taken, in milliseconds.