GearBlocks
The GearBlocks Lua scripting API
Public Member Functions | List of all members
SmashHammer.Profiling.ProfilerAsset Class Reference

The profiler. More...

Inheritance diagram for SmashHammer.Profiling.ProfilerAsset:
SmashHammer.Profiling.IProfiler

Public Member Functions

IProfilerMetricRecorder CreateMetricRecorder (string category, string name, int capacity=1)
 Create a profile metric recorder.
 
void DestroyMetricRecorder (string category, string name)
 Destroy a previously created profile metric recorder.
 
void DestroyMetricRecorder (IProfilerMetricRecorder metricRecorder)
 Destroy a previously created profile metric recorder.
 
IProfilerMetricRecorder CreateMetricRecorder (string category, string name, int capacity=1)
 Create a profile metric recorder.
 
void DestroyMetricRecorder (string category, string name)
 Destroy a previously created profile metric recorder.
 
void DestroyMetricRecorder (IProfilerMetricRecorder metricRecorder)
 Destroy a previously created profile metric recorder.
 

Detailed Description

The profiler.

Available in Lua via the "Profiler" global, for example:

local recorder = Profiler.CreateMetricRecorder( 'Render', 'Draw Calls Count' )
Do something with the recorder here.
Profiler.DestroyMetricRecorder( recorder )

Member Function Documentation

◆ CreateMetricRecorder()

IProfilerMetricRecorder SmashHammer.Profiling.ProfilerAsset.CreateMetricRecorder ( string  category,
string  name,
int  capacity = 1 
)

Create a profile metric recorder.

Parameters
categoryProfiler category name.
nameProfiler marker or counter name.
capacityMaximum amount of samples to be collected.
Returns
The created metric recorder.

Implements SmashHammer.Profiling.IProfiler.

◆ DestroyMetricRecorder() [1/2]

void SmashHammer.Profiling.ProfilerAsset.DestroyMetricRecorder ( string  category,
string  name 
)

Destroy a previously created profile metric recorder.

Parameters
categoryProfiler category name.
nameProfiler marker or counter name.

Implements SmashHammer.Profiling.IProfiler.

◆ DestroyMetricRecorder() [2/2]

void SmashHammer.Profiling.ProfilerAsset.DestroyMetricRecorder ( IProfilerMetricRecorder  metricRecorder)

Destroy a previously created profile metric recorder.

Parameters
metricRecorderThe metric recorder to destroy.

Implements SmashHammer.Profiling.IProfiler.