Implemented node system statistics
This commit is contained in:
@@ -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
|
||||
);
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user