Navigation
API > API/Plugins > API/Plugins/WorldMetricsCore
World metrics subsystem
This subsystem provides an interface to add and remove world metrics implementing the UWorldMetricInterface class.
- Added metrics get automatically updated by the subsystem's ticker.
- The subsystem becomes an owner of all added metrics. The user is responsible for removing them when no longer needed so they can be garbage collected.
- Metrics can have extensions to add shared functionality.
- Extensions implement the UWorldMetricsExtension class and use Acquire/Release semantics. They can be acquired by either metrics or extensions. Initialization and deinitialization are the ideal phases to do so.
- The subsystem solely owns extensions and can automatically remove them for garbage collection whenever they are no longer acquired by any metric or extension.
| Name | UWorldMetricsSubsystem |
| Type | class |
| Header File | /Engine/Plugins/WorldMetrics/Source/WorldMetricsCore/Public/WorldMetricsSubsystem.h |
| Include Path | #include "WorldMetricsSubsystem.h" |
Syntax
UCLASS (MinimalAPI, Config=Engine, defaultconfig)
class UWorldMetricsSubsystem : public UWorldSubsystem
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → USubsystem → UWorldSubsystem → UWorldMetricsSubsystem
Structs
| Name | Remarks |
|---|---|
| FExtension |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOwnerList | TSet< UObject *, DefaultKeyFuncs< UObject * >, TInlineSetAllocator< DefaultOwnerListCapacity > > | WorldMetricsSubsystem.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DefaultExtensionCapacity | int32 | WorldMetricsSubsystem.h | |
| DefaultOwnerListCapacity | int32 | WorldMetricsSubsystem.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| UpdateRateInSeconds | float | WorldMetricsSubsystem.h |
|
|
| WarmUpFrames | int32 | The number of frames the subsystem waits to update added metrics after their initialization. | WorldMetricsSubsystem.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Extensions | TMap< TSubclassOf< UWorldMetricsExtension >, FExtension, TInlineSetAllocator< DefaultExtensionCapacity > > | Exposed to GC via AddReferencedObjects. | WorldMetricsSubsystem.h | |
| Metrics | TArray< TObjectPtr< UWorldMetricInterface > > | WorldMetricsSubsystem.h |
|
|
| PendingWarmUpFrames | int32 | WorldMetricsSubsystem.h | ||
| UpdateTickerHandle | FTSTicker::FDelegateHandle | WorldMetricsSubsystem.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UWorldMetricsExtension * AcquireExtension
(
UWorldMetricInterface* InOwner, |
Acquires an extension on behalf of a object. | WorldMetricsSubsystem.h | |
UWorldMetricsExtension * AcquireExtension
(
UWorldMetricsExtension* InOwner, |
WorldMetricsSubsystem.h | ||
ExtensionClass * AcquireExtension
(
UWorldMetricsExtension* InExtensionOwner |
WorldMetricsSubsystem.h | ||
ExtensionClass * AcquireExtension
(
UWorldMetricInterface* InMetricOwner |
WorldMetricsSubsystem.h | ||
bool AddMetric
(
UWorldMetricInterface* InMetric |
Adds the parameter metric instance to the subsystem. | WorldMetricsSubsystem.h | |
UWorldMetricInterface * AddMetric
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Adds a new metric instance of the parameter class to the subsystem. | WorldMetricsSubsystem.h | |
MetricClass * AddMetric () |
WorldMetricsSubsystem.h | ||
virtual void BeginDestroy() |
WorldMetricsSubsystem.h | ||
bool ContainsMetric
(
UWorldMetricInterface* InMetric |
WorldMetricsSubsystem.h | ||
MetricClass * CreateMetric () |
WorldMetricsSubsystem.h | ||
UWorldMetricInterface * CreateMetric
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Factory method to create world metric instances. | WorldMetricsSubsystem.h | |
virtual void Deinitialize() |
WorldMetricsSubsystem.h | ||
void ForEachMetric
(
const TFunctionRef< bool(const UWorldMetricInterface*)>& Func |
Const iteration method for each of the metrics added to the subsystem. | WorldMetricsSubsystem.h | |
void ForEachMetricOfClass
(
const TFunctionRef< bool(const MetricClass*)>& Func |
Const iteration method for each of the metrics added to the subsystem of the template argument class. | WorldMetricsSubsystem.h | |
bool HasAnyExtension() |
WorldMetricsSubsystem.h | ||
bool HasAnyMetric() |
WorldMetricsSubsystem.h | ||
virtual void Initialize
(
FSubsystemCollectionBase& Collection |
WorldMetricsSubsystem.h | ||
bool IsEnabled() |
WorldMetricsSubsystem.h | ||
int32 NumExtensions() |
WorldMetricsSubsystem.h | ||
int32 NumMetrics() |
WorldMetricsSubsystem.h | ||
bool ReleaseExtension
(
UWorldMetricInterface* InOwner, |
Releases a metric's ownership of an extension. | WorldMetricsSubsystem.h | |
bool ReleaseExtension
(
UWorldMetricInterface* InOwner |
WorldMetricsSubsystem.h | ||
bool ReleaseExtension
(
UWorldMetricsExtension* InExtensionOwner |
WorldMetricsSubsystem.h | ||
bool ReleaseExtension
(
UWorldMetricsExtension* InOwner, |
WorldMetricsSubsystem.h | ||
bool RemoveMetric
(
UWorldMetricInterface* InMetric |
Removes the parameter metric instance if it was previously added. | WorldMetricsSubsystem.h | |
void SetUpdateRateInSeconds
(
float InSeconds |
Sets the subsystem update ticker rate in seconds. | WorldMetricsSubsystem.h | |
virtual bool ShouldCreateSubsystem
(
UObject* Outer |
WorldMetricsSubsystem.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
WorldMetricsSubsystem.h | ||
static bool CanHaveWorldMetrics
(
const UWorld* World |
WorldMetricsSubsystem.h | ||
static UWorldMetricsSubsystem * Get
(
const UWorld* World |
WorldMetricsSubsystem.h |