Navigation
API > API/Runtime > API/Runtime/NetCore
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.
| Name | TBinnedMovingValue |
| Type | class |
| Header File | /Engine/Source/Runtime/Net/Core/Public/Net/Core/Analytics/NetStatsUtils.h |
| Include Path | #include "Net/Core/Analytics/NetStatsUtils.h" |
Syntax
template<typename ConsumerType, int32 NumBins, EBinnedValueMode InMode>
class TBinnedMovingValue :
public UE::Net::FBinnedMovingValueBase ,
public UE::Net::TSampleProducer< ConsumerType >
Inheritance Hierarchy
- FBinnedMovingValueBase → TBinnedMovingValue
- TSampleProducer → TBinnedMovingValue
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TBinnedMovingValue
(
double TimePerBin |
Main constructor | Net/Core/Analytics/NetStatsUtils.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Bins | FBin | Allocation for the bins which collect moving values | Net/Core/Analytics/NetStatsUtils.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddMeasurement
(
double TimeVal, |
Inputs a measurement value and the approximate time it was measured. | Net/Core/Analytics/NetStatsUtils.h | |
void Flush () |
Flushes a sample from the current bin values to the consumer. | Net/Core/Analytics/NetStatsUtils.h |