Fairly generic histogram for values that have natural lower bound and possibly no upper bound, e.g., frame time 更多...
#include <Histogram.h>
类 | |
| struct | FBin |
| Bin 更多... | |
Public 成员函数 | |
| void | AddMeasurement (double Value) |
| Adds an observed measurement. | |
| void | AddMeasurement (double ValueForBinning, double MeasurementValue) |
| Adds an observed measurement (with a different thresholding key than the measurement, e.g., when accumulating time spent in a chart keyed on framerate). | |
| FString | DumpToJsonString () const |
| Same as DumpToJsonString but uses a DefaultConvertBinToLabel. | |
| FString | DumpToJsonString (TFunctionRef< FString(double, double)> ConvertBinToLabel) const |
| Returns a string in a Json format: [{"Bin":"BinName","Count":Count,"Sum":Sum},...]. 更多... | |
| FString | DumpToJsonString2 () const |
| Same as DumpToJsonString2 but uses a DefaultConvertBinToLabel. | |
| FString | DumpToJsonString2 (TFunctionRef< FString(double, double)> ConvertBinToLabel) const |
| Returns a string in a Json format: [{"BinName":{"Count":Count,"Sum":Sum}},...]. 更多... | |
| void | DumpToLog (const FString &HistogramName) |
| Prints histogram contents to the log. | |
| double | GetAverageOfAllMeasures () const |
| Returns the average of all measurements (essentially a shortcut for Sum/Count). | |
| double | GetBinLowerBound (int IdxBin) const |
| Gets lower bound of the bin, i.e. 更多... | |
| int32 | GetBinObservationsCount (int IdxBin) const |
| Gets number of observations in the bin. | |
| double | GetBinObservationsSum (int IdxBin) const |
| Gets sum of observations in the bin. | |
| double | GetBinUpperBound (int IdxBin) const |
| Gets upper bound of the bin, i.e. 更多... | |
| double | GetMaxOfAllMeasures () const |
| Returns the maximum of all measurements. | |
| double | GetMinOfAllMeasures () const |
| Returns the minimum of all measurements. | |
| int32 | GetNumBins () const |
| Gets number of bins. | |
| int64 | GetNumMeasurements () const |
| Returns the sum of all counts (the number of recorded measurements) | |
| double | GetSumOfAllMeasures () const |
| Returns the sum of all measurements | |
| FORCEINLINE void | InitFromArray (std::initializer_list< 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 | 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 | InitHitchTracking () |
| Inits histogram to mimic our existing hitch buckets | |
| void | InitLinear (double MinTime, double MaxTime, double BinSize) |
| Inits histogram with linear, equally sized bins | |
| void | Reset () |
| Resets measurements, without resetting the configured bins. | |
静态 Public 成员函数 | |
| static FString | DefaultConvertBinToLabel (double MinValue, double UpperBound) |
| Default stringifier for bins for use with DumpToJsonString. 更多... | |
Protected 属性 | |
| TArray< FBin > | Bins |
| Bins themselves, should be continous in terms of [MinValue; UpperBound) and sorted ascending by MinValue. 更多... | |
| friend | FHistogramBuilder |
| This is exposed as a clean way to build bins while enforcing the condition mentioned above | |
| double | SumOfAllMeasures |
| Quick stats for all bins | |
Fairly generic histogram for values that have natural lower bound and possibly no upper bound, e.g., frame time
|
static |
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 | ( | 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 | ( | 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.
|
inline |
Gets lower bound of the bin, i.e.
minimum value that goes into it.
|
inline |
Gets upper bound of the bin, i.e.
first value that does not go into it.
Bins themselves, should be continous in terms of [MinValue; UpperBound) and sorted ascending by MinValue.
Last bin's UpperBound doesn't matter