UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
HealthSnapshot.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"
7#include "HealthSnapshot.generated.h"
8
10
11UCLASS(MinimalAPI)
13{
14
16
17
21 UFUNCTION(Exec, BlueprintCallable, Category = "Performance | HealthSnapshot")
22 static ENGINE_API void StartPerformanceSnapshots();
23
27 UFUNCTION(Exec, BlueprintCallable, Category = "Performance | HealthSnapshot")
28 static ENGINE_API void StopPerformanceSnapshots();
29
30
36 UFUNCTION(Exec, BlueprintCallable, Category = "Performance | HealthSnapshot")
37 static ENGINE_API void LogPerformanceSnapshot(const FString SnapshotTitle, bool bResetStats=true);
38
39 /* The performance chart we register with the engine for tracking */
41};
42
54{
55public:
56
63
71
72 virtual ~FHealthSnapshot() {}
73
81
82protected:
83
85 ENGINE_API virtual void CaptureMemoryStats();
86
89
90 /* Dump a text blob describing all stats captured by the snapshot to the given output device with the given log category. */
91 ENGINE_API virtual void DumpStats(FOutputDevice& Ar, FName CategoryName);
92
93public:
94
95 // Helper class that can describe memory in a system. Some systems may not provide Used/Peak values.
96 template<typename T>
98 {
100 : Size(T())
101 , Used(T())
102 , Peak(T())
103 {}
104
108 };
109
111 {
115 , AvgTime(0)
116 {}
117
120 float AvgTime;
121 };
122
123 template <typename T>
124 struct FMmaStat
125 {
127 : Min()
128 , Max()
129 , Avg()
130 {}
131
135 };
136
138 // General "how much memory is used"
141 // System level info
144 FMmaStat<uint64> PhysicalMemory; // more detailed physical memory stats obtained more frequently
147
149 double MeasuredPerfTime; // Duration of time the following performance values came from
156 double MVP;
157 double AvgFPS;
162
164 FString Title;
165};
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition HealthSnapshot.h:54
virtual ~FHealthSnapshot()
Definition HealthSnapshot.h:72
FMmaStat< uint64 > VirtualMemory
Definition HealthSnapshot.h:145
FThreadStat GPU
Definition HealthSnapshot.h:153
FThreadStat GameThread
Definition HealthSnapshot.h:150
FMmaStat< int > DrawCalls
Definition HealthSnapshot.h:158
FMmaStat< double > DynamicResolution
Definition HealthSnapshot.h:161
FMmaStat< uint64 > PhysicalMemory
Definition HealthSnapshot.h:144
FMemoryStat< float > CPUMemoryMB
Definition HealthSnapshot.h:139
FThreadStat RHIThread
Definition HealthSnapshot.h:152
FThreadStat RenderThread
Definition HealthSnapshot.h:151
FMmaStat< int > PrimitivesDrawn
Definition HealthSnapshot.h:159
double AvgHitchTime
Definition HealthSnapshot.h:155
double AvgFPS
Definition HealthSnapshot.h:157
virtual ENGINE_API void CaptureMemoryStats()
Definition HealthSnapshot.cpp:52
TArray< typename FPlatformMemoryStats::FPlatformSpecificStat > PlatformMemoryStats
Definition HealthSnapshot.h:146
virtual ENGINE_API void CapturePerformanceStats(const FPerformanceTrackingChart *GameplayFPSChart)
Definition HealthSnapshot.cpp:101
virtual ENGINE_API void DumpStats(FOutputDevice &Ar, FName CategoryName)
Definition HealthSnapshot.cpp:189
FMemoryStat< float > PhysicalMemoryMB
Definition HealthSnapshot.h:142
double MVP
Definition HealthSnapshot.h:156
double MeasuredPerfTime
Definition HealthSnapshot.h:149
FString Title
Definition HealthSnapshot.h:164
ENGINE_API void Dump(FOutputDevice &Ar)
Definition HealthSnapshot.cpp:171
double HitchesPerMinute
Definition HealthSnapshot.h:154
FMmaStat< double > FrameTime
Definition HealthSnapshot.h:160
FMemoryStat< float > StreamingMemoryMB
Definition HealthSnapshot.h:140
float LLMTotalMemoryMB
Definition HealthSnapshot.h:143
Definition NameTypes.h:617
Definition OutputDevice.h:133
Definition ChartCreation.h:141
Definition Array.h:670
Definition SharedPointer.h:692
Definition BlueprintFunctionLibrary.h:16
Definition HealthSnapshot.h:13
Definition HealthSnapshot.h:98
T Peak
Definition HealthSnapshot.h:107
T Size
Definition HealthSnapshot.h:105
T Used
Definition HealthSnapshot.h:106
FMemoryStat()
Definition HealthSnapshot.h:99
Definition HealthSnapshot.h:125
FMmaStat()
Definition HealthSnapshot.h:126
T Min
Definition HealthSnapshot.h:132
T Avg
Definition HealthSnapshot.h:134
T Max
Definition HealthSnapshot.h:133
Definition HealthSnapshot.h:111
float AvgTime
Definition HealthSnapshot.h:120
float PercentFramesBound
Definition HealthSnapshot.h:118
float HitchesPerMinute
Definition HealthSnapshot.h:119
FThreadStat()
Definition HealthSnapshot.h:112