Open 3D Engine Multiplayer Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Multiplayer::MultiplayerStatSystemComponent Class Referencefinal

#include <MultiplayerStatSystemComponent.h>

Inherits AZ::Component, and Multiplayer::IMultiplayerStatSystem.

Public Member Functions

 AZ_COMPONENT (MultiplayerStatSystemComponent, "{890831db-3ca4-4d8c-a43e-d53d1197044d}")
 
void Activate () override
 
void Deactivate () override
 
void Register () override
 
void Unregister () override
 De-initialize the system.
 
void SetReportPeriod (AZ::TimeMs period) override
 
void DeclareStatGroup (int uniqueGroupId, const char *groupName) override
 
void DeclareStat (int uniqueGroupId, int uniqueStatId, const char *statName) override
 
void SetStat (int uniqueStatId, double value) override
 
void IncrementStat (int uniqueStatId) override
 
- Public Member Functions inherited from Multiplayer::IMultiplayerStatSystem
 AZ_RTTI (IMultiplayerStatSystem, "{B7689E92-9D5F-469D-97FA-5709BCD94DED}")
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 

Detailed Description

Periodically writes the metrics to AZ::EventLogger. See MultiplayerStatSystem.h for documentation.

Member Function Documentation

◆ Activate()

void Multiplayer::MultiplayerStatSystemComponent::Activate ( )
override

AZ::Component overrides.

◆ DeclareStat()

void Multiplayer::MultiplayerStatSystemComponent::DeclareStat ( int  uniqueGroupId,
int  uniqueStatId,
const char *  statName 
)
overridevirtual

Declares a stat belonging to an existing group.

Parameters
uniqueGroupIda group id already declared with DECLARE_PERFORMANCE_STAT_GROUP
uniqueStatIda stat id already declared with DECLARE_PERFORMANCE_STAT
statNamename of the stat, this does NOT take the ownership of the string

Implements Multiplayer::IMultiplayerStatSystem.

◆ DeclareStatGroup()

void Multiplayer::MultiplayerStatSystemComponent::DeclareStatGroup ( int  uniqueGroupId,
const char *  groupName 
)
overridevirtual

Declares a stat group with a name using a unique id. It's recommended to use DECLARE_PERFORMANCE_STAT_GROUP macro instead.

Parameters
uniqueGroupIda unique id for a group of stats
groupNamea name for the group

Implements Multiplayer::IMultiplayerStatSystem.

◆ IncrementStat()

void Multiplayer::MultiplayerStatSystemComponent::IncrementStat ( int  uniqueStatId)
overridevirtual

It's recommended to use INCREASE_PERFORMANCE_STAT macro instead. Increments the value of a given stat by one (1) that has been already declared with DECLARE_PERFORMANCE_STAT Note: metrics will take the average value of a stat within the period configured with @SetReportPeriod and reset to back to zero each time.

Parameters
uniqueStatIda unique stat id

Implements Multiplayer::IMultiplayerStatSystem.

◆ Register()

void Multiplayer::MultiplayerStatSystemComponent::Register ( )
overridevirtual

◆ SetReportPeriod()

void Multiplayer::MultiplayerStatSystemComponent::SetReportPeriod ( AZ::TimeMs  period)
overridevirtual

Change how often metrics are written to AZ::EventLogger.

Parameters
periodtime in milliseconds between recording events

Implements Multiplayer::IMultiplayerStatSystem.

◆ SetStat()

void Multiplayer::MultiplayerStatSystemComponent::SetStat ( int  uniqueStatId,
double  value 
)
overridevirtual

It's recommended to use SET_PERFORMANCE_STAT macro instead. Updates the value of a given stat already declared with DECLARE_PERFORMANCE_STAT Note: metrics will take the average value of a stat within the period configured with @SetReportPeriod

Parameters
uniqueStatIda unique stat id
valuecurrent value

Implements Multiplayer::IMultiplayerStatSystem.


The documentation for this class was generated from the following file: