UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PerfCountersHelpers.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
7#if USE_SERVER_PERF_COUNTERS
8
9 #include "PerfCountersModule.h"
10
13 void ENGINE_API PerfCountersSet(const FString& Name, float Val, uint32 Flags = 0);
14
17 void ENGINE_API PerfCountersSet(const FString& Name, int32 Val, uint32 Flags = 0);
18
21 void ENGINE_API PerfCountersSet(const FString& Name, const FString& Val, uint32 Flags = 0);
22
33
36 float ENGINE_API PerfCountersGet(const FString& Name, float DefaultVal);
37
40 double ENGINE_API PerfCountersGet(const FString& Name, double DefaultVal);
41
45
49
50#else
51
54 inline void PerfCountersSet(const FString& Name, float Val, uint32 Flags = 0) { /* no-op */ };
55 inline void PerfCountersSet(const FString& Name, int32 Val, uint32 Flags = 0) { /* no-op */ };
56 inline void PerfCountersSet(const FString& Name, const FString& Val, uint32 Flags = 0) { /* no-op */ };
57 inline int32 PerfCountersIncrement(const FString & Name, int32 Add = 1, int32 DefaultValue = 0, uint32 Flags = 0) { return DefaultValue + Add; };
58 inline float ENGINE_API PerfCountersGet(const FString& Name, float DefaultVal) { return DefaultVal; }
59 inline double ENGINE_API PerfCountersGet(const FString& Name, double DefaultVal) { return DefaultVal; }
60 inline int32 ENGINE_API PerfCountersGet(const FString& Name, int32 DefaultVal) { return DefaultVal; }
61 inline uint32 ENGINE_API PerfCountersGet(const FString& Name, uint32 DefaultVal) { return DefaultVal; }
62
63#endif //USE_SERVER_PERF_COUNTERS
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void PerfCountersSet(const FString &Name, float Val, uint32 Flags=0)
Definition PerfCountersHelpers.h:54
int32 PerfCountersIncrement(const FString &Name, int32 Add=1, int32 DefaultValue=0, uint32 Flags=0)
Definition PerfCountersHelpers.h:57
float ENGINE_API PerfCountersGet(const FString &Name, float DefaultVal)
Definition PerfCountersHelpers.h:58
float Val(const FString &Value)
Definition UnrealMath.cpp:3163
uint32_t uint32
Definition binka_ue_file_header.h:6
@ Transient
Definition PerfCountersModule.h:54