SleakEngine
1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
SystemMetrics.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
Core/OSDef.hpp
>
4
5
namespace
Sleak
{
6
7
/// Snapshot of OS-reported CPU/RAM/GPU usage at the moment of the last Query.
8
/// @ingroup debug
9
struct
SystemMetricsData
{
10
float
CpuUsagePercent
= 0.0f;
11
float
RamUsageMB
= 0.0f;
12
float
GpuUsagePercent
= 0.0f;
13
float
GpuMemoryUsedMB
= 0.0f;
14
};
15
16
/// Polls platform-specific counters (PDH on Windows, /proc on Linux) for CPU/RAM/GPU usage.
17
/// @ingroup debug
18
class
ENGINE_API
SystemMetrics
{
19
public
:
20
static
void
Initialize
();
21
static
void
Shutdown
();
22
/// Reads the current CPU/RAM/GPU usage from the OS.
23
static
SystemMetricsData
Query
();
24
25
private
:
26
static
bool
s_initialized;
27
};
28
29
}
// namespace Sleak
OSDef.hpp
Sleak::SystemMetrics
Definition
SystemMetrics.hpp:18
Sleak::SystemMetrics::Initialize
static void Initialize()
Definition
SystemMetrics.cpp:106
Sleak::SystemMetrics::Shutdown
static void Shutdown()
Definition
SystemMetrics.cpp:110
Sleak::SystemMetrics::Query
static SystemMetricsData Query()
Reads the current CPU/RAM/GPU usage from the OS.
Definition
SystemMetrics.cpp:114
Sleak
Root namespace for everything the engine exposes.
Definition
Camera.hpp:10
Sleak::SystemMetricsData
Definition
SystemMetrics.hpp:9
Sleak::SystemMetricsData::GpuUsagePercent
float GpuUsagePercent
Definition
SystemMetrics.hpp:12
Sleak::SystemMetricsData::RamUsageMB
float RamUsageMB
Definition
SystemMetrics.hpp:11
Sleak::SystemMetricsData::GpuMemoryUsedMB
float GpuMemoryUsedMB
Definition
SystemMetrics.hpp:13
Sleak::SystemMetricsData::CpuUsagePercent
float CpuUsagePercent
Definition
SystemMetrics.hpp:10
include
public
Debug
SystemMetrics.hpp
Generated on
for SleakEngine by
1.16.1