Implemented node system statistics
This commit is contained in:
49
MoonlightServers.Shared/Admin/Nodes/NodeStatisticsDto.cs
Normal file
49
MoonlightServers.Shared/Admin/Nodes/NodeStatisticsDto.cs
Normal 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
|
||||
);
|
||||
@@ -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>))]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user