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,22 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using MoonlightServers.Daemon.Helpers;
using MoonlightServers.Daemon.Mappers;
using MoonlightServers.DaemonShared.Http.Daemon;
namespace MoonlightServers.Daemon.Http.Controllers;
[Authorize]
[ApiController]
[Route("api/system")]
public class SystemController : Controller
{
[HttpGet("statistics")]
public async Task<ActionResult<SystemStatisticsDto>> GetStatisticsAsync()
{
var snapshot = await SystemMetrics.ReadAllAsync();
var statistics = SystemStatisticsMapper.ToDto(snapshot);
return statistics;
}
}