A Go-based backend service that simulates backup job execution, collects metrics, detects bottlenecks, and provides optimization recommendations.
- Simulates backup job execution with configurable agents
- Collects metrics (latency, throughput, error rates)
- Implements bottleneck detection engine
- Provides optimization recommendations (load redistribution, network path optimization)
- Includes basic recommendations based on metric thresholds
- Includes advanced, topology-aware recommendations when network topology data is available
- Exposes REST API for monitoring and control
- Dual storage: SQLite for metrics, MongoDB for metadata
- Simple CLI to start/stop simulation and configure parameters
cmd/simulator/main.go- Application entry pointinternal/api/- HTTP API handlersinternal/simulation/- Backup job simulationinternal/analysis/- Bottleneck detectioninternal/storage/- Database interactions (SQLite & MongoDB)internal/network/- Path optimization algorithmsinternal/optimizer/- Recommendation generationconfig/- Configuration loadingDockerfile- Docker image build instructionsdocker-compose.yml- Docker Compose file for easy setup of the application and its dependencies (MongoDB)
- Go 1.22+ (for local development)
- Docker and Docker Compose (for containerized deployment)
- OR SQLite and MongoDB (for local development without Docker)
go mod downloadgo run ./cmd/simulator# Build and start all services
docker-compose up --build
# To run in detached mode
docker-compose up -d --build
# To stop and remove containers
docker-compose down
# To stop containers but keep volumes
docker-compose stopTests are located in the ./tests directory, organized by package. To run all tests:
go test ./tests/... -v