first
This commit is contained in:
36
run_stress_test.bat
Normal file
36
run_stress_test.bat
Normal file
@@ -0,0 +1,36 @@
|
||||
@echo off
|
||||
echo Checking for Python installation...
|
||||
|
||||
:: Kiểm tra xem Python có được cài đặt không
|
||||
py --version >nul 2>&1
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo Error: Python is not installed or not added to PATH.
|
||||
echo Please install Python from https://www.python.org/ and ensure it's added to PATH.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: Kiểm tra xem file stress_test.py có tồn tại không
|
||||
if not exist "stress_test.py" (
|
||||
echo Error: stress_test.py not found in the current directory.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:: Kiểm tra và cài đặt thư viện requests nếu chưa có
|
||||
echo Checking for requests library...
|
||||
py -c "import requests" >nul 2>&1
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo Installing requests library...
|
||||
pip install requests
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo Error: Failed to install requests library.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
:: Chạy file stress_test.py
|
||||
echo Running stress_test.py...
|
||||
py stress_test.py
|
||||
pause
|
||||
Reference in New Issue
Block a user