Add start-service.bat script for Resource Monitor Service v2.0

- Introduced a batch script to simplify the startup process for the Resource Monitor Service.
- Included checks for .NET 9.0 Runtime installation.
- Added build and run commands for the service with appropriate error handling.
- Provided user instructions and API documentation links in the script output.
This commit is contained in:
Phoenix
2025-08-07 02:39:54 +08:00
parent 294438145a
commit 823e467078
17 changed files with 10419 additions and 363 deletions
+69
View File
@@ -0,0 +1,69 @@
namespace ResourceMonitorService.Configuration
{
public class MonitoringSettings
{
public int UpdateIntervalMs { get; set; } = 5000; // 5 seconds
public int DataRetentionDays { get; set; } = 7;
public bool EnableGpuMonitoring { get; set; } = true;
public bool EnableDiskMonitoring { get; set; } = true;
public bool EnableNetworkMonitoring { get; set; } = true;
public bool EnableTemperatureMonitoring { get; set; } = true;
public bool EnableProcessMonitoring { get; set; } = true;
public bool EnableGameDetection { get; set; } = true;
public bool EnableAlerts { get; set; } = true;
public int MaxProcessesToTrack { get; set; } = 10;
public int MaxHistoryPoints { get; set; } = 1000;
public List<string> GamePlatformPaths { get; set; } = new()
{
@"\steamapps\common\",
@"\Epic Games\",
@"\GOG Galaxy\Games\",
@"\Origin Games\",
@"\Ubisoft Game Launcher\games\"
};
public List<AlertThresholdConfig> AlertThresholds { get; set; } = new()
{
new() { Component = "CPU", WarningThreshold = 80, CriticalThreshold = 95, DurationSeconds = 30 },
new() { Component = "Memory", WarningThreshold = 85, CriticalThreshold = 95, DurationSeconds = 30 },
new() { Component = "GPU", WarningThreshold = 85, CriticalThreshold = 95, DurationSeconds = 30 },
new() { Component = "CPUTemp", WarningThreshold = 75, CriticalThreshold = 85, DurationSeconds = 60 },
new() { Component = "GPUTemp", WarningThreshold = 80, CriticalThreshold = 90, DurationSeconds = 60 }
};
}
public class AlertThresholdConfig
{
public string Component { get; set; } = string.Empty;
public float WarningThreshold { get; set; }
public float CriticalThreshold { get; set; }
public int DurationSeconds { get; set; } = 30;
public bool IsEnabled { get; set; } = true;
}
public class ApiSettings
{
public string ApiKey { get; set; } = string.Empty;
public bool RequireApiKey { get; set; } = false;
public List<string> AllowedOrigins { get; set; } = new()
{
"http://localhost:4200",
"http://192.168.50.52:4200",
"http://vmwin11:4200"
};
public bool EnableSwagger { get; set; } = false;
public string BasePath { get; set; } = "/api";
}
public class LoggingSettings
{
public string LogLevel { get; set; } = "Information";
public string LogPath { get; set; } = "logs";
public int MaxLogFiles { get; set; } = 30;
public long MaxLogFileSizeMB { get; set; } = 10;
public bool EnableFileLogging { get; set; } = true;
public bool EnableConsoleLogging { get; set; } = true;
public bool EnablePerformanceLogging { get; set; } = false;
}
}