Implemented node system statistics

This commit is contained in:
2026-03-21 18:21:09 +00:00
parent ba5e364c05
commit 6d447a0ff9
28 changed files with 1402 additions and 156 deletions

View File

@@ -0,0 +1,49 @@
namespace MoonlightServers.DaemonShared.Http.Daemon;
public record SystemStatisticsDto(
CpuSnapshotDto Cpu,
MemoryInfoDto Memory,
IReadOnlyList<DiskInfoDto> Disks,
IReadOnlyList<NetworkInterfaceInfoDto> Network,
TimeSpan Uptime
);
public record CpuSnapshotDto(
string ModelName,
double TotalUsagePercent,
IReadOnlyList<double> CoreUsagePercents
);
public record MemoryInfoDto(
long TotalBytes,
long UsedBytes,
long FreeBytes,
long CachedBytes,
long BuffersBytes,
long AvailableBytes,
double UsedPercent
);
public record DiskInfoDto(
string MountPoint,
string Device,
string FileSystem,
long TotalBytes,
long UsedBytes,
long FreeBytes,
double UsedPercent,
long InodesTotal,
long InodesUsed,
long InodesFree,
double InodesUsedPercent
);
public record NetworkInterfaceInfoDto(
string Name,
long RxBytesPerSec,
long TxBytesPerSec,
long RxPacketsPerSec,
long TxPacketsPerSec,
long RxErrors,
long TxErrors
);

View File

@@ -5,6 +5,7 @@ using MoonlightServers.DaemonShared.Http.Daemon;
namespace MoonlightServers.DaemonShared.Http;
[JsonSerializable(typeof(HealthDto))]
[JsonSerializable(typeof(SystemStatisticsDto))]
[JsonSerializable(typeof(ProblemDetails))]
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web)]