Enhance monitoring features and UI:

- Add detailed CPU core monitoring option for better performance control
- Update monitoring settings in app configuration
- Improve parallel task execution for resource usage monitoring
- Modify Telegram notification service to skip alerts from svchost processes
- Add "Memory %" column to process table in HTML and update related JavaScript
- Create performance test scripts for API response time evaluation
This commit is contained in:
Din
2025-08-08 16:19:45 +08:00
parent bb7c4c3d0e
commit 3d1c55468b
10 changed files with 236 additions and 34 deletions
+27
View File
@@ -0,0 +1,27 @@
# Quick API Test Command
# Run this after starting the service with: dotnet run
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
try {
$response = Invoke-WebRequest -Uri "http://localhost:5000/api/resource/usage" -UseBasicParsing
$stopwatch.Stop()
$content = $response.Content | ConvertFrom-Json
Write-Host "✅ API Response Time: $($stopwatch.ElapsedMilliseconds)ms" -ForegroundColor Green
Write-Host " Status: $($response.StatusCode)" -ForegroundColor Cyan
Write-Host " CPU Usage: $($content.CPU.Usage)%" -ForegroundColor White
Write-Host " Memory Usage: $($content.Memory.UsagePercentage)%" -ForegroundColor White
Write-Host " Core Count: $($content.CPU.CoreUsages.Length)" -ForegroundColor White
if ($stopwatch.ElapsedMilliseconds -lt 1000) {
Write-Host "🚀 Excellent performance!" -ForegroundColor Green
} elseif ($stopwatch.ElapsedMilliseconds -lt 2000) {
Write-Host "✅ Good performance" -ForegroundColor Yellow
} else {
Write-Host "⚠️ Could be faster" -ForegroundColor Red
}
}
catch {
$stopwatch.Stop()
Write-Host "❌ Error after $($stopwatch.ElapsedMilliseconds)ms: $($_.Exception.Message)" -ForegroundColor Red
}