R-Type
Networked shoot'em up built on Aegis2D
Loading...
Searching...
No Matches
lagometer.hpp File Reference

The figures of the lagometer: the network statistics of the last seconds, sampled. More...

#include <aegis2d/net/rtt.hpp>
#include <aegis2d/net/traffic.hpp>
#include <rtype/network_stats.hpp>
#include <array>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <deque>
#include <optional>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  rtype::LagSample
 The figures of every graph at one time, in the unit of each graph. More...
 
class  rtype::Lagometer
 The last seconds of the network statistics, for the graphs of the lagometer. More...
 

Namespaces

namespace  rtype
 R-Type game code, built on the Aegis2D engine.
 

Enumerations

enum class  rtype::LagGraph : std::uint8_t {
  rtype::Rtt , rtype::Jitter , rtype::Loss , rtype::Interval ,
  rtype::BytesIn , rtype::BytesOut , rtype::Corrections
}
 A graph of the lagometer. More...
 
enum class  rtype::LagLevel : std::uint8_t { rtype::Good , rtype::Warning , rtype::Bad }
 How a figure compares with a sound link. More...
 

Functions

LagSample rtype::measure_lag (const aegis2d::net::RttEstimator &rtt, const aegis2d::net::TrafficCounters &traffic, const NetworkStats &stats, std::chrono::steady_clock::time_point now)
 Reads the network statistics of the client into a sample.
 
LagLevel rtype::lag_level (LagGraph graph, double value) noexcept
 Level of a value of a graph: the RTT is bad above 200 ms, the loss above 5 %...
 
std::string rtype::lag_label (LagGraph graph, double value)
 Label of a value of a graph, for the overlay: "RTT 152 MS", "LOSS 2.5 %".
 
std::vector< std::string > rtype::lag_lines (const LagSample &sample)
 The figures of a sample as lines of the engine's metrics overlay, so that the frame metrics (F12) show the network too, with or without the lagometer (F6).
 

Variables

constexpr std::size_t rtype::lag_graph_count = 7
 Number of graphs: LagGraph values are 0 to lag_graph_count - 1.
 

Detailed Description

The figures of the lagometer: the network statistics of the last seconds, sampled.