47 lines
1.3 KiB
Batchfile
47 lines
1.3 KiB
Batchfile
@echo off
|
|
REM Health Probe Simulator Startup Script (Windows)
|
|
REM This script starts the health probe simulator that continuously sends heartbeats
|
|
|
|
echo 🏥 Starting Health Probe Simulator...
|
|
echo ==================================
|
|
|
|
REM Set defaults if not provided
|
|
if not defined PROBE_FAILRATE set PROBE_FAILRATE=30
|
|
if not defined PROBE_INTERVAL_SECONDS set PROBE_INTERVAL_SECONDS=60
|
|
if not defined API_BASE_URL set API_BASE_URL=https://selfservice.cqers.com/drones/api
|
|
|
|
echo 🔧 Configuration:
|
|
echo Failure Rate: %PROBE_FAILRATE%%%
|
|
echo Probe Interval: %PROBE_INTERVAL_SECONDS% seconds
|
|
echo API URL: %API_BASE_URL%
|
|
echo.
|
|
|
|
REM Check if running with Docker
|
|
if "%1"=="docker" (
|
|
echo 🐳 Starting with Docker Compose...
|
|
docker-compose --profile healthprobe up healthprobe
|
|
) else (
|
|
echo 💻 Running locally...
|
|
|
|
REM Check if Python is available
|
|
python --version >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ❌ Python is required but not installed
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Check if requests module is available
|
|
python -c "import requests" >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo 📦 Installing requests module...
|
|
pip install requests
|
|
)
|
|
|
|
REM Run the health probe simulator
|
|
echo 🚀 Starting health probe simulator...
|
|
python health_probe_simulator.py
|
|
)
|
|
|
|
pause
|