File size: 2,001 Bytes
0021b08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@echo off
REM FastAPI Processing Simulator - Client Runner
REM This script provides easy ways to run the WebSocket client

echo.
echo ================================================
echo  FastAPI Processing Simulator - Client Runner
echo ================================================
echo.

REM Check if Python is available
python --version >nul 2>&1
if errorlevel 1 (
    echo Error: Python is not installed or not in PATH
    echo Please install Python and try again.
    pause
    exit /b 1
)

REM Check if websockets module is available
python -c "import websockets" >nul 2>&1
if errorlevel 1 (
    echo Installing required websockets module...
    pip install websockets
    if errorlevel 1 (
        echo Error: Failed to install websockets module
        pause
        exit /b 1
    )
)

:menu
echo.
echo Select an option:
echo 1. Interactive mode (default)
echo 2. Quick test (sample data)
echo 3. Stress test (5 concurrent requests)
echo 4. Custom automated test
echo 5. Exit
echo.
set /p choice="Enter your choice (1-5): "

if "%choice%"=="1" goto interactive
if "%choice%"=="2" goto quicktest
if "%choice%"=="3" goto stresstest
if "%choice%"=="4" goto customtest
if "%choice%"=="5" goto exit
if "%choice%"=="" goto interactive

echo Invalid choice. Please try again.
goto menu

:interactive
echo.
echo Starting interactive mode...
python client.py --interactive
goto menu

:quicktest
echo.
echo Running quick test with sample data...
python client.py --folder "sample-folder" --env "production"
pause
goto menu

:stresstest
echo.
echo Running stress test with 5 concurrent requests...
python client.py --stress 5
pause
goto menu

:customtest
echo.
set /p folder="Enter folder name: "
set /p env="Enter environment: "
set /p url="Enter WebSocket URL (or press Enter for default): "

if "%url%"=="" (
    python client.py --folder "%folder%" --env "%env%"
) else (
    python client.py --url "%url%" --folder "%folder%" --env "%env%"
)
pause
goto menu

:exit
echo.
echo Goodbye!
exit /b 0