public async Task <SystemOverview> GetSystemOverview() { var overview = new SystemOverview(); using (var process = Process.GetCurrentProcess()) { overview.MemoryUsage = ByteDisplayConverter.Convert(process.PrivateMemorySize64); var gcMemoryInfo = GC.GetGCMemoryInfo(); overview.MemoryUsagePercentage = (process.PrivateMemorySize64 / gcMemoryInfo.TotalAvailableMemoryBytes) * 100; overview.CpuUsagePercentage = await GetCpuUsage(process); } return(overview); }
public string GetSizeDisplayModel() => ByteDisplayConverter.Convert(Size ?? 0);