3d1c55468b
- 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
28 lines
1.2 KiB
PowerShell
28 lines
1.2 KiB
PowerShell
# 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
|
|
}
|