diff --git a/Moonlight/App/Helpers/HostSystemHelper.cs b/Moonlight/App/Helpers/HostSystemHelper.cs
index 344bed5..57df6d7 100644
--- a/Moonlight/App/Helpers/HostSystemHelper.cs
+++ b/Moonlight/App/Helpers/HostSystemHelper.cs
@@ -1,4 +1,5 @@
-using System.Runtime.InteropServices;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
using Logging.Net;
namespace Moonlight.App.Helpers;
@@ -45,4 +46,19 @@ public class HostSystemHelper
return "N/A";
}
}
+
+ public int GetMemoryUsage()
+ {
+ var process = Process.GetCurrentProcess();
+ var bytes = process.WorkingSet64;
+ return (int)(bytes / (1024.0 * 1024.0));
+ }
+
+ public int GetCpuUsage()
+ {
+ var process = Process.GetCurrentProcess();
+ var cpuTime = process.TotalProcessorTime;
+ var wallClockTime = DateTime.UtcNow - process.StartTime.ToUniversalTime();
+ return (int)(100.0 * cpuTime.TotalMilliseconds / wallClockTime.TotalMilliseconds / Environment.ProcessorCount);
+ }
}
\ No newline at end of file
diff --git a/Moonlight/Shared/Views/Admin/Sys/Index.razor b/Moonlight/Shared/Views/Admin/Sys/Index.razor
index fc10ea0..f740a7e 100644
--- a/Moonlight/Shared/Views/Admin/Sys/Index.razor
+++ b/Moonlight/Shared/Views/Admin/Sys/Index.razor
@@ -9,7 +9,7 @@