FStatsHierarchical

A helper class with static methods to perform hierarchical profiling

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Stats/StatsHierarchical.h

Include

#include "Stats/StatsHierarchical.h"

Syntax

class FStatsHierarchical

Remarks

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.

Functions

Name Description

Public function Static

void

 

BeginMeasurements()

Enabled measurements / profiling.

Public function Static

void

 

DumpMeasurements

(
    FMessageLog& Log,
    bool bSortByDuration
)

Prints the results into a provided log.

Public function Static

FStatsTreeEl...

 

EndMeasurements

(
    FStatsTreeElement MeasurementsToMer...,
    bool bAddUntrackedElements
)

Ends measurements / profiling and returns the compacted profiling tree.

Public function Static

FStatsTreeEl...

 

GetLastMeasurements()

Returns the last recorded profiling tree.

Public function Static

FName

 

GetUntrackedTimeName()

Returns the name to use for untracked time.

Public function Static

bool

 

IsEnabled()

Returns true if measurements are enabled.

Classes

Name

Description

Public struct

FHierarchicalStatEntry

A single entry for profiling. This data is used internally only and should not be used directly.

Public struct

FScope

Helper class to create a local scope for profiling.

Constants

Name

Description

bEnabled

Entries

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss