Skip to main content

NetworkTransportStatisticField

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

One network traffic counter for the profiler. Reads a running total from a function you pass in and reports it relative to the last reset.

Constructors​

MemberWhat it is
NetworkTransportStatisticField(Func<int> getValueFunction, NetworkTransportStatisticType statisticType = 0)Creates a NetworkTransportStatisticField from getValueFunction and statisticType.

Fields​

MemberWhat it is
protected const int NumberPaddingWidthColumn width (10) used to pad numbers in summaries.
protected const int StringPaddingWidthColumn width (30) used to pad labels in summaries.
7 private and internal fields
MemberWhat it is
private int currentValueThe raw counter value read from getValueFunction on the last UpdateValue.
private Func<int> getValueFunctionThe function that reads the underlying transport counter, passed to the constructor.
private int oldByteValueValue at the last UpdateValuePerLastSecond call, used to work out the per-second change.
private int startValueThe raw counter value when totals were last reset; Value counts up from here.
private NetworkTransportStatisticType statisticTypeWhat the counter measures (bytes by default), shown in the inspector.
private int valueBacking field for Value: the counter's change since the last reset.
private float valuePerLastSecondBacking field for ValuePerLastSecond: how much Value grew between the last two per-second updates.

Properties​

MemberWhat it is
int Value { get; }Total counted since the last ResetStatisticTotals, as of the last UpdateValue.
float ValuePerLastSecond { get; }Growth of Value between the last two UpdateValuePerLastSecond calls.

Methods​

MemberWhat it is
virtual string GetSummary(float statisticDuration)Text line with the total bytes and the bytes per second over the given duration.
void ResetStatisticTotals()Makes the current total the new zero point, so Value counts from now.
override string ToString()The current Value as text.
void UpdateValue()Reads the source function and sets Value to the amount since the last reset.
void UpdateValuePerFrame()Not implemented. Throws NotImplementedException.
void UpdateValuePerLastSecond()Sets ValuePerLastSecond to how much Value grew since the previous call. Meant to be called once a second.

Used in​

Members of other types that take, return or hold a NetworkTransportStatisticField: