![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <NetStatsUtils.h>
Inheritance diagram for UE::Net::TBinnedMovingValue< ConsumerType, NumBins, InMode >:Public Member Functions | |
| TBinnedMovingValue (double TimePerBin) | |
| void | AddMeasurement (double TimeVal, double Value) |
| void | Flush () |
Public Member Functions inherited from UE::Net::FBinnedMovingValueBase | |
| NETCORE_API double | GetSample () const |
| NETCORE_API void | Reset () |
Public Member Functions inherited from UE::Net::TSampleProducer< ConsumerType > | |
| void | SetConsumer (ConsumerType *InConsumer) |
Additional Inherited Members | |
Protected Member Functions inherited from UE::Net::FBinnedMovingValueBase | |
| FBinnedMovingValueBase ()=delete | |
| NETCORE_API | FBinnedMovingValueBase (const TArrayView< FBin > InBins, double InTimePerBin, EBinnedValueMode InMode) |
| NETCORE_API void | AddMeasurement_Implementation (double TimeVal, double Value, TOptional< double > &OutSample) |
Protected Member Functions inherited from UE::Net::TSampleProducer< ConsumerType > | |
| void | OutputSample (double Value) |
| template<typename InnerConsumerType = ConsumerType, typename = typename TEnableIf<TModels_V<CPeekMeasurements, InnerConsumerType>>::Type> | |
| void | PeekMeasurement (double TimeVal, double Value) |
| template<typename InnerConsumerType = ConsumerType, typename = typename TEnableIf<!TModels_V<CPeekMeasurements, InnerConsumerType>>::Type, int32 UnusedParamForODR = 0> | |
| void | PeekMeasurement (double TimeVal, double Value) |
Tracks/stores a moving average or moving sum over a period of time, binning the accumulated values into different time periods, for smoothing and balancing the memory/accuracy cost of dropping old values as they fall out of the measured time period.
Use TBinnedMovingAvg/TBinnedMovingSum aliases, instead of using this directly.
Measurements are input using AddMeasurement, and samples/values are output to the specified consumer, which is set using SetConsumer.
Samples are automatically output when all of the data bins fill and are rolled over - this guarantees perfect accuracy over the full time period. Samples can be manually output using Flush, but this can be less accurate depending on the use case - see Flush for more information.
| ConsumerType | The type which will be used for consuming samples. |
| NumBins | The number of bins to use. |
| InMode | Internal |
|
inlineexplicit |
Main constructor
| TimePerBin | The amount of time that each bin represents. |
|
inline |
Inputs a measurement value and the approximate time it was measured.
| TimeVal | The time of the measurement. |
| Value | The measurement value |
|
inline |
Flushes a sample from the current bin values to the consumer.
Since this is a moving value, none of the bins are reset when a sample is output (so the flushed sample can partially reflect old values), and the current bin will have been reset recently so it can be filled (so the flushed value may not reflect the full time period).
The user must consider whether this is accurate/suitable for their use case.