# 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 }