Skip to content

DalgoT4D/load_testing

Repository files navigation

Dalgo Dashboard Load Testing

Load testing tool for Dalgo dashboard APIs using Locust.

Setup

  1. Copy environment configuration:

    cp .env.example .env
  2. Update .env with your credentials:

    # Edit .env file with your actual values
    [email protected]
    DALGO_PASSWORD=your-password
    DALGO_ORG_SLUG=your-org-slug
    DALGO_HOST=http://localhost:8002
  3. Install dependencies:

    uv sync

Usage

Basic Examples

# Use default settings from .env
python main.py

# Custom test with 50 users, 5/sec spawn rate, 10 minutes
python main.py -u 50 -s 5 -t 10m

# Test against production
python main.py --host https://api.dalgo.in --users 20

# Run with web UI for real-time monitoring
python main.py --web-ui

CLI Options

python main.py -h  # Show help

Options:
  -u, --users         Number of concurrent users (default: from .env)
  -s, --spawn-rate    Rate to spawn users per second (default: from .env)
  -t, --time          Test duration (e.g., 5m, 30s, 1h) (default: from .env)
  --host             Backend host URL (default: from .env)
  --web-ui           Run with web UI instead of headless mode

Test Flow

Each simulated user follows this realistic flow:

  1. Login via API with credentials from .env
  2. Fetch Dashboards - Get list of available dashboards
  3. Select Dashboard - Pick one randomly and extract charts
  4. Repeatedly Hit APIs with different frequencies:
    • Dashboard data refresh (highest frequency)
    • Individual chart data refresh (high frequency)
    • Dashboard config requests (medium frequency)

Reports

After each test run, you'll get:

  • HTML Report: dashboard_load_test_TIMESTAMP.html - Visual performance report
  • CSV Reports: dashboard_load_test_TIMESTAMP_*.csv - Raw data for analysis

Environment Variables

Variable Description Example
DALGO_USERNAME Your Dalgo login email [email protected]
DALGO_PASSWORD Your Dalgo password your-password
DALGO_ORG_SLUG Organization slug test_auto
DALGO_HOST Backend API URL http://localhost:8002
DEFAULT_USERS Default concurrent users 10
DEFAULT_SPAWN_RATE Default spawn rate 2
DEFAULT_DURATION Default test duration 5m

Duration Formats

  • 30s = 30 seconds
  • 5m = 5 minutes
  • 1h = 1 hour
  • 90m = 90 minutes

About

Load test Dalgo features & functionality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages