@mytec: before 3.0 REFACTOR
This commit is contained in:
128
installer/test-detailed-quick.bat
Normal file
128
installer/test-detailed-quick.bat
Normal file
@@ -0,0 +1,128 @@
|
||||
@echo off
|
||||
title RFCP - Detailed Preset Quick Test
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
echo ============================================
|
||||
echo RFCP - Detailed Preset Quick Test
|
||||
echo ============================================
|
||||
echo.
|
||||
echo This tests ONLY the Detailed preset to check
|
||||
echo if NumPy vectorization is working.
|
||||
echo.
|
||||
echo Expected: ^< 90 seconds (was 300s timeout)
|
||||
echo ============================================
|
||||
echo.
|
||||
|
||||
set API=http://127.0.0.1:8888
|
||||
|
||||
:: Check if server is running
|
||||
echo [1/4] Checking server...
|
||||
curl -s -o nul -w "HTTP %%{http_code}" %API%/api/health >nul 2>&1
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo ERROR: Server not responding! Start rfcp-debug.bat first.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
echo Server OK
|
||||
echo.
|
||||
|
||||
:: Get baseline
|
||||
echo [2/4] Capturing baseline...
|
||||
for /f %%a in ('powershell -NoProfile -Command "(Get-CimInstance Win32_OperatingSystem).FreePhysicalMemory"') do set /a BASE_FREE=%%a/1024
|
||||
for /f %%a in ('tasklist /FI "IMAGENAME eq rfcp-server.exe" 2^>nul ^| find /c "rfcp-server"') do set BASE_PROCS=%%a
|
||||
echo Free RAM: %BASE_FREE% MB
|
||||
echo RFCP procs: %BASE_PROCS%
|
||||
echo.
|
||||
|
||||
:: Run test
|
||||
echo [3/4] Running Detailed preset (5km, 300m)...
|
||||
echo Start: %time%
|
||||
echo.
|
||||
|
||||
curl -s -w "\n HTTP: %%{http_code}\n Time: %%{time_total} seconds\n" ^
|
||||
-X POST %API%/api/coverage/calculate ^
|
||||
-H "Content-Type: application/json" ^
|
||||
-d "{\"sites\": [{\"lat\": 50.45, \"lon\": 30.52, \"height\": 30, \"power\": 43, \"gain\": 15, \"frequency\": 1800}], \"settings\": {\"radius\": 5000, \"resolution\": 300, \"preset\": \"detailed\"}}" ^
|
||||
-o detailed-result.json
|
||||
|
||||
echo.
|
||||
echo End: %time%
|
||||
echo.
|
||||
|
||||
:: Check result
|
||||
echo [4/4] Analyzing result...
|
||||
|
||||
:: Check for timeout
|
||||
findstr /C:"timeout" detailed-result.json >nul 2>&1
|
||||
if %ERRORLEVEL% EQU 0 (
|
||||
echo.
|
||||
echo ============================================
|
||||
echo RESULT: TIMEOUT
|
||||
echo Vectorization needs more optimization.
|
||||
echo ============================================
|
||||
echo.
|
||||
type detailed-result.json
|
||||
goto :cleanup
|
||||
)
|
||||
|
||||
:: Check for success (has "points")
|
||||
findstr /C:"\"points\"" detailed-result.json >nul 2>&1
|
||||
if %ERRORLEVEL% EQU 0 (
|
||||
echo.
|
||||
echo ============================================
|
||||
echo RESULT: SUCCESS!
|
||||
echo Detailed preset completed without timeout!
|
||||
echo ============================================
|
||||
echo.
|
||||
|
||||
:: Extract stats
|
||||
echo Extracting stats from result...
|
||||
|
||||
:: Count points (rough)
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /C:"\"count\"" detailed-result.json') do (
|
||||
echo Points calculated: %%a
|
||||
)
|
||||
|
||||
:: Get computation time
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /C:"\"computation_time\"" detailed-result.json') do (
|
||||
echo Computation time: %%a seconds
|
||||
)
|
||||
|
||||
goto :cleanup
|
||||
)
|
||||
|
||||
:: Unknown result
|
||||
echo.
|
||||
echo RESULT: UNKNOWN
|
||||
echo Check detailed-result.json manually
|
||||
type detailed-result.json
|
||||
|
||||
:cleanup
|
||||
echo.
|
||||
echo ============================================
|
||||
echo POST-TEST CLEANUP CHECK
|
||||
echo ============================================
|
||||
|
||||
timeout /t 3 /nobreak >nul
|
||||
|
||||
for /f %%a in ('powershell -NoProfile -Command "(Get-CimInstance Win32_OperatingSystem).FreePhysicalMemory"') do set /a END_FREE=%%a/1024
|
||||
for /f %%a in ('tasklist /FI "IMAGENAME eq rfcp-server.exe" 2^>nul ^| find /c "rfcp-server"') do set END_PROCS=%%a
|
||||
|
||||
set /a MEM_DIFF=BASE_FREE-END_FREE
|
||||
|
||||
echo Free RAM: %END_FREE% MB (was %BASE_FREE% MB, diff: %MEM_DIFF% MB)
|
||||
echo RFCP procs: %END_PROCS% (was %BASE_PROCS%)
|
||||
|
||||
if %MEM_DIFF% GTR 500 (
|
||||
echo.
|
||||
echo WARNING: Memory not fully released!
|
||||
)
|
||||
|
||||
if %END_PROCS% GTR %BASE_PROCS% (
|
||||
echo.
|
||||
echo WARNING: Extra RFCP processes still running!
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ============================================
|
||||
pause
|
||||
Reference in New Issue
Block a user