All in One Benchmark 1.0.0
Run Benchmarks in Unreal
Loading...
Searching...
No Matches
UFtsBenchmarkSubsystem Class Reference

Benchmark subsystem that takes care of running a single benchmark in a level. More...

#include <FtsBenchmarkSubsystem.h>

Inheritance diagram for UFtsBenchmarkSubsystem:

Public Member Functions

ALevelSequenceActor * GetBenchmarkSequenceActor () const
 Getter for the sequence actor for current benchmark.
void StartPresetBenchmark (FPrimaryAssetId BenchmarkId)
 Start a benchmark from a data asset.
void StartPresetBenchmarkAsset (const UFtsBenchmarkDefinitionDataAsset *BenchmarkAsset)
 Start a benchmark from a data asset.
void StartBenchmark ()
 Start a benchmark.
void StopBenchmark ()
 Stop a benchmark, happens by default when the level sequence stops.
bool IsBenchmarkInProgress ()
 Checks whether a benchmark is currently running.
void StartMeasurement (FName Label)
 Starts running a new measurement.
bool IsMeasurementInProgress () const
 Check if there is an ongoing measurement.
void StopMeasurement ()
 Stops the actively running benchmark.
void ClearMeasurement ()
 Clears the last recorded data.
void ClearResults ()
 Clears all recorded data.
void LogFPS (float FPS)
 Logs a single FPS data point.
bool GetActiveMeasurement (FFtsBenchmarkMeasurement &OutMeasurement)
 Get the data of the measurement currently in progress.
bool GetBenchmarkResult (FFtsBenchmarkResult &OutResult)
 Get the data of the benchmark currently in progress.
void SetBenchmarkResult (const FFtsBenchmarkResult &InResult)
 Sets benchmark data, overriding previous measurements.
bool GetComment (FString &OutComment) const
void SetComment (const FString &InComment)
void AddMetaData (const FString &Key, const FString &Data)
void GetMetaData (TMap< FString, FString > &OutMetaData)
void RecordSystemSpecs ()
 Gather system info into benchmark data.

Public Attributes

FFtsBenchmarkStateChangeSignature OnBenchmarkStarted
FFtsBenchmarkStateChangeSignature OnBenchmarkStopped
FFtsBenchmarkStateChangeSignature OnMeasurementStarted
FFtsBenchmarkStateChangeSignature OnMeasurementStopped

Protected Attributes

TSharedPtr< FFtsBenchmarkMeasurementActiveMeasurement
 Measurements of the currently running benchmark.
TSharedPtr< FFtsBenchmarkResultBenchmarkResult
 Log of all previous measurements.
ALevelSequenceActor * BenchmarkSequenceActor = nullptr
 Held pointer to the actively playing benchmark sequence.

Detailed Description

Benchmark subsystem that takes care of running a single benchmark in a level.

It takes care of measuring performance and can save the results to file. Starting a benchmark runs a level sequence identified by an Actor Tag. The Sequence needs to have a Benchmark Track inside it that starts and stops measurements.

Member Function Documentation

◆ GetActiveMeasurement()

bool UFtsBenchmarkSubsystem::GetActiveMeasurement ( FFtsBenchmarkMeasurement & OutMeasurement)

Get the data of the measurement currently in progress.

Parameters
OutMeasurementMeasurement data
Returns
True if measurement data was returned

◆ GetBenchmarkResult()

bool UFtsBenchmarkSubsystem::GetBenchmarkResult ( FFtsBenchmarkResult & OutResult)

Get the data of the benchmark currently in progress.

Parameters
OutResultBenchmark data
Returns
True if benchmark data was returned

◆ GetBenchmarkSequenceActor()

ALevelSequenceActor * UFtsBenchmarkSubsystem::GetBenchmarkSequenceActor ( ) const

Getter for the sequence actor for current benchmark.

Returns
Sequence actor for the current benchmark

◆ IsBenchmarkInProgress()

bool UFtsBenchmarkSubsystem::IsBenchmarkInProgress ( )

Checks whether a benchmark is currently running.

Returns
True when benchmark is running

◆ IsMeasurementInProgress()

bool UFtsBenchmarkSubsystem::IsMeasurementInProgress ( ) const

Check if there is an ongoing measurement.

Returns
True if there is an active measurement

◆ LogFPS()

void UFtsBenchmarkSubsystem::LogFPS ( float FPS)

Logs a single FPS data point.

Parameters
FPSFrames Per Second to log

◆ SetBenchmarkResult()

void UFtsBenchmarkSubsystem::SetBenchmarkResult ( const FFtsBenchmarkResult & InResult)

Sets benchmark data, overriding previous measurements.

Parameters
InResultNew data

◆ StartMeasurement()

void UFtsBenchmarkSubsystem::StartMeasurement ( FName Label)

Starts running a new measurement.

Parameters
LabelIdentifier of the benchmark

◆ StartPresetBenchmark()

void UFtsBenchmarkSubsystem::StartPresetBenchmark ( FPrimaryAssetId BenchmarkId)

Start a benchmark from a data asset.

Parameters
BenchmarkIdAsset Id for benchmark to run

◆ StartPresetBenchmarkAsset()

void UFtsBenchmarkSubsystem::StartPresetBenchmarkAsset ( const UFtsBenchmarkDefinitionDataAsset * BenchmarkAsset)

Start a benchmark from a data asset.

Parameters
BenchmarkAssetAsset for benchmark to run

The documentation for this class was generated from the following files:
  • Plugins/FtsBenchmark/Source/FtsBenchmark/Public/FtsBenchmarkSubsystem.h
  • Plugins/FtsBenchmark/Source/FtsBenchmark/Private/FtsBenchmarkSubsystem.cpp