Skip to main content

NetworkingStatistic

A class in Root.Township, Alta.Utilities.Profiling.NetworkTransportMetrics.

Counter for one kind of network message in the transport metrics: how many were sent and how many bytes.

Constructors​

MemberWhat it is
NetworkingStatistic()Creates a NetworkingStatistic with default values.

Fields​

MemberWhat it is
protected const int NumberPaddingWidthColumn width for numbers in summaries (10).
protected const int StringPaddingWidthColumn width for names in summaries (30).
5 private and internal fields
MemberWhat it is
private float bytesPerFrameAverage bytes per message (total bytes over message count), despite the name. Backing field for BytesPerFrame.
private float bytesPerLastSecondBytes added since the previous per-second update. Backing field for BytesPerLastSecond.
private int countNumber of messages registered. Backing field for Count.
private int oldBytesTotal bytes at the previous per-second update, used to work out bytesPerLastSecond.
private int totalBytesBytes registered since the last reset. Backing field for TotalBytes.

Properties​

MemberWhat it is
float BytesPerFrame { get; }Despite the name, average bytes per message (total bytes over count), as of the last update.
float BytesPerLastSecond { get; }Bytes sent since the previous per-second update.
int Count { get; }Messages counted since the last reset.
int TotalBytes { get; }Bytes counted since the last reset.

Methods​

MemberWhat it is
virtual string GetSummary(float statisticDuration)One padded text line with count, total bytes, average and bytes per second over the given duration.
void RegisterMessageSend(int byteSize)Counts one message of the given size.
virtual void ResetStatisticTotals()Zeroes the count and byte totals.
virtual void UpdateValuePerFrame()Recomputes BytesPerFrame.
virtual void UpdateValuePerLastSecond()Recomputes BytesPerLastSecond. Meant to be called once a second.