150 lines
5.7 KiB
C#
150 lines
5.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ResourceMonitorService.Models
|
|
{
|
|
public class SystemInfo
|
|
{
|
|
public string MachineName { get; set; } = string.Empty;
|
|
public string OSVersion { get; set; } = string.Empty;
|
|
public string OSArchitecture { get; set; } = string.Empty;
|
|
public int ProcessorCount { get; set; }
|
|
public ulong TotalPhysicalMemory { get; set; }
|
|
public string CPUName { get; set; } = string.Empty;
|
|
public DateTime BootTime { get; set; }
|
|
public TimeSpan Uptime { get; set; }
|
|
public string Domain { get; set; } = string.Empty;
|
|
public bool IsVirtualMachine { get; set; }
|
|
public string HypervisorVendor { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class ResourceUsage
|
|
{
|
|
public DateTime Timestamp { get; set; }
|
|
public CpuUsage CPU { get; set; } = new();
|
|
public MemoryUsage Memory { get; set; } = new();
|
|
public GpuUsage GPU { get; set; } = new();
|
|
public List<DiskUsage> Disks { get; set; } = new();
|
|
public List<ProcessInfo> TopProcesses { get; set; } = new();
|
|
public TemperatureInfo Temperature { get; set; } = new();
|
|
public GameInfo? RunningGame { get; set; }
|
|
}
|
|
|
|
public class CpuUsage
|
|
{
|
|
public float Usage { get; set; }
|
|
public float[] CoreUsages { get; set; } = Array.Empty<float>();
|
|
public float Temperature { get; set; }
|
|
public float MaxFrequency { get; set; }
|
|
public float CurrentFrequency { get; set; }
|
|
public bool IsThrottling { get; set; }
|
|
}
|
|
|
|
public class MemoryUsage
|
|
{
|
|
public float UsagePercentage { get; set; }
|
|
public ulong UsedMemory { get; set; }
|
|
public ulong AvailableMemory { get; set; }
|
|
public ulong TotalMemory { get; set; }
|
|
public ulong CommittedMemory { get; set; }
|
|
public ulong PagedMemory { get; set; }
|
|
public ulong NonPagedMemory { get; set; }
|
|
}
|
|
|
|
public class GpuUsage
|
|
{
|
|
public uint Usage { get; set; }
|
|
public uint MemoryUsage { get; set; }
|
|
public uint Temperature { get; set; }
|
|
public uint FanSpeed { get; set; }
|
|
public uint PowerUsage { get; set; }
|
|
public ulong MemoryTotal { get; set; }
|
|
public ulong MemoryUsed { get; set; }
|
|
public bool IsAvailable { get; set; }
|
|
public string Error { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string DriverVersion { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class DiskUsage
|
|
{
|
|
public string DriveLetter { get; set; } = string.Empty;
|
|
public string Label { get; set; } = string.Empty;
|
|
public string FileSystem { get; set; } = string.Empty;
|
|
public ulong TotalSize { get; set; }
|
|
public ulong FreeSpace { get; set; }
|
|
public ulong UsedSpace { get; set; }
|
|
public float UsagePercentage { get; set; }
|
|
public float ReadSpeed { get; set; } // MB/s
|
|
public float WriteSpeed { get; set; } // MB/s
|
|
public float DiskTime { get; set; } // % disk time
|
|
public uint Temperature { get; set; }
|
|
public bool IsSSD { get; set; }
|
|
public long ReadOperations { get; set; }
|
|
public long WriteOperations { get; set; }
|
|
}
|
|
|
|
public class ProcessInfo
|
|
{
|
|
public int ProcessId { get; set; }
|
|
public string Name { get; set; } = string.Empty;
|
|
public float CpuUsage { get; set; }
|
|
public ulong MemoryUsage { get; set; }
|
|
public float MemoryUsagePercentage { get; set; }
|
|
public TimeSpan ProcessorTime { get; set; }
|
|
public DateTime StartTime { get; set; }
|
|
public string ExecutablePath { get; set; } = string.Empty;
|
|
public string CommandLine { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class TemperatureInfo
|
|
{
|
|
public float CPU { get; set; }
|
|
public float GPU { get; set; }
|
|
public float Motherboard { get; set; }
|
|
public List<HardDriveTemp> HardDrives { get; set; } = new();
|
|
}
|
|
|
|
public class HardDriveTemp
|
|
{
|
|
public string Drive { get; set; } = string.Empty;
|
|
public float Temperature { get; set; }
|
|
public string Health { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class GameInfo
|
|
{
|
|
public string GameName { get; set; } = string.Empty;
|
|
public string ExecutableName { get; set; } = string.Empty;
|
|
public string FullPath { get; set; } = string.Empty;
|
|
public int ProcessId { get; set; }
|
|
public ulong MemoryUsage { get; set; }
|
|
public TimeSpan CpuTime { get; set; }
|
|
public DateTime StartTime { get; set; }
|
|
public string Platform { get; set; } = string.Empty; // Steam, Epic, etc.
|
|
public bool IsFullscreen { get; set; }
|
|
public float FPS { get; set; }
|
|
}
|
|
|
|
public class AlertThreshold
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Component { get; set; } = string.Empty; // CPU, Memory, GPU, Disk, Network
|
|
public float WarningThreshold { get; set; }
|
|
public float CriticalThreshold { get; set; }
|
|
public bool IsEnabled { get; set; }
|
|
public TimeSpan Duration { get; set; } // How long the threshold must be exceeded
|
|
}
|
|
|
|
public class Alert
|
|
{
|
|
public DateTime Timestamp { get; set; }
|
|
public string Component { get; set; } = string.Empty;
|
|
public string Level { get; set; } = string.Empty; // Warning, Critical
|
|
public string Message { get; set; } = string.Empty;
|
|
public float CurrentValue { get; set; }
|
|
public float ThresholdValue { get; set; }
|
|
public bool IsResolved { get; set; }
|
|
public DateTime? ResolvedAt { get; set; }
|
|
}
|
|
}
|