[Network] Measure real server round-trip times

Time each command container from send to response with QElapsedTimer,
aggregate samples in a fixed-size ring buffer (last/median/p95/max),
and emit aggregated pingStatsUpdated at most once per second so the
hot path stays free of signal traffic. Stats are cleared on
disconnect. Forward the signal through ConnectionController for UI
consumers. Unit-tested in latency_tracker_test.

Took 37 minutes

Took 4 minutes

# Commit time for manual adjustment:
# Took 8 minutes
This commit is contained in:
Lukas Brübach 2026-08-22 18:54:42 +02:00
parent 5ba543f333
commit eddbbf2d7b
12 changed files with 398 additions and 2 deletions

View file

@ -29,3 +29,13 @@ int PendingCommand::tick()
{
return ++ticks;
}
void PendingCommand::startTiming()
{
startTime.start();
}
qint64 PendingCommand::elapsedMs() const
{
return startTime.isValid() ? startTime.nsecsElapsed() / 1000000 : -1;
}