![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <Histogram.h>
Classes | |
| struct | FBin |
Static Public Member Functions | |
| static CORE_API FString | DefaultConvertBinToLabel (double MinValue, double UpperBound) |
Protected Attributes | |
| TArray< FBin > | Bins |
| double | SumOfAllMeasures |
| int64 | CountOfAllMeasures |
| double | MinimalMeasurement |
| double | MaximalMeasurement |
| friend | FHistogramBuilder |
Fairly generic histogram for values that have natural lower bound and possibly no upper bound, e.g., frame time
Adds an observed measurement (with a different thresholding key than the measurement, e.g., when accumulating time spent in a chart keyed on framerate).
Default stringifier for bins for use with DumpToJsonString. Truncates to int and uses Plus as the suffix for the last bin. ie. [0.0, 3.75, 9.8] -> 0_3, 3_9, 9_Plus
| FString FHistogram::DumpToJsonString | ( | ) | const |
Same as DumpToJsonString but uses a DefaultConvertBinToLabel.
| FString FHistogram::DumpToJsonString | ( | TFunctionRef< FString(double, double)> | ConvertBinToLabel | ) | const |
Returns a string in a Json format: [{"Bin":"BinName","Count":Count,"Sum":Sum},...]. Bucket name is constructed by calling ConvertBinToLabel on the MinValue and UpperBound for each bin. Convert function is used to allow the bin range, which is stored as a double, to be printed prettily.
| FString FHistogram::DumpToJsonString2 | ( | ) | const |
Same as DumpToJsonString2 but uses a DefaultConvertBinToLabel.
| FString FHistogram::DumpToJsonString2 | ( | TFunctionRef< FString(double, double)> | ConvertBinToLabel | ) | const |
Returns a string in a Json format: [{"BinName":{"Count":Count,"Sum":Sum}},...]. Bucket name is constructed by calling ConvertBinToLabel on the MinValue and UpperBound for each bin. Convert function is used to allow the bin range, which is stored as a double, to be printed prettily.
| void FHistogram::DumpToLog | ( | const FString & | HistogramName | ) |
Prints histogram contents to the log.
|
inline |
Returns the average of all measurements (essentially a shortcut for Sum/Count).
|
inline |
Gets lower bound of the bin, i.e. minimum value that goes into it.
|
inline |
Gets number of observations in the bin.
|
inline |
Gets sum of observations in the bin.
|
inline |
Gets upper bound of the bin, i.e. first value that does not go into it.
|
inline |
Returns the maximum of all measurements.
|
inline |
Returns the minimum of all measurements.
|
inline |
Gets number of bins.
|
inline |
Returns the sum of all counts (the number of recorded measurements)
|
inline |
Returns the sum of all measurements
|
inline |
Inits histogram with the specified bin boundaries, with the final bucket extending to infinity (e.g., passing in 0,5 creates a [0..5) bucket and a [5..infinity) bucket)
| void FHistogram::InitFromArray | ( | TArrayView< const double > | Thresholds | ) |
Inits histogram with the specified bin boundaries, with the final bucket extending to infinity (e.g., passing in 0,5 creates a [0..5) bucket and a [5..infinity) bucket)
| void FHistogram::InitHitchTracking | ( | ) |
Inits histogram to mimic our existing hitch buckets
Inits histogram with linear, equally sized bins
|
inline |
|
inline |
|
inline |
| void FHistogram::Reset | ( | ) |
Resets measurements, without resetting the configured bins.
Bins themselves, should be continous in terms of [MinValue; UpperBound) and sorted ascending by MinValue. Last bin's UpperBound doesn't matter
|
protected |
|
protected |
This is exposed as a clean way to build bins while enforcing the condition mentioned above
|
protected |
|
protected |
|
protected |
Quick stats for all bins