Navigation
API > API/Runtime > API/Runtime/Core
A helper class with static methods to perform hierarchical profiling
The FStatsHierarchical class / namespace can be used to record profiling data in a hierarchical fashion - by nesting scopes in functions that call each other. Profiling entries are recorded per invocation as raw data to ensure minimal impact on the runtime performance - and then can be compacted into a tree at a later time for reporting / display.
Users should refer to the DECLARE_SCOPE_HIERARCHICAL_COUNTER macro instead to place scopes.
Users need to call FStatsHierarchical::BeginMeasurements() and FStatsHierarchical::EndMeasurements() to enable / disable the profiling.
Note: This system is not thread-safe. You want to call it from a single thread only.
| Name | FStatsHierarchical |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Stats/StatsHierarchical.h |
| Include Path | #include "Stats/StatsHierarchical.h" |
Syntax
class FStatsHierarchical
Structs
| Name | Remarks |
|---|---|
| FHierarchicalStatEntry | A single entry for profiling. This data is used internally only and should not be used directly. |
| FScope | Helper class to create a local scope for profiling. |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bEnabled | bool | Stats/StatsHierarchical.h | |
| Entries | TArray< FHierarchicalStatEntry > | Stats/StatsHierarchical.h |
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void BeginMeasurement
(
const ANSICHAR* Label |
Begins a single measurement given a label. | Stats/StatsHierarchical.h | |
static void BeginMeasurements() |
Enabled measurements / profiling. | Stats/StatsHierarchical.h | |
static void DumpMeasurements
(
FMessageLog& Log, |
Prints the results into a provided log. | Stats/StatsHierarchical.h | |
static void EndMeasurement() |
Ends the last measurement. | Stats/StatsHierarchical.h | |
static FStatsTreeElement EndMeasurements
(
FStatsTreeElement MeasurementsToMerge, |
Ends measurements / profiling and returns the compacted profiling tree. | Stats/StatsHierarchical.h | |
static FStatsTreeElement GetLastMeasurements() |
Returns the last recorded profiling tree. | Stats/StatsHierarchical.h | |
static FName GetUntrackedTimeName() |
Returns the name to use for untracked time. | Stats/StatsHierarchical.h | |
static bool IsEnabled() |
Returns true if measurements are enabled. | Stats/StatsHierarchical.h |