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.Shared.Admin.Nodes;
public record NodeStatisticsDto(
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

@@ -11,6 +11,8 @@ namespace MoonlightServers.Shared;
// - Node
[JsonSerializable(typeof(CreateNodeDto))]
[JsonSerializable(typeof(UpdateNodeDto))]
[JsonSerializable(typeof(NodeHealthDto))]
[JsonSerializable(typeof(NodeStatisticsDto))]
[JsonSerializable(typeof(NodeDto))]
[JsonSerializable(typeof(PagedData<NodeDto>))]