# Classic ramp test: climb to 50 VUs, hold, ramp down — with think time
# between requests so VUs behave like humans.
name: ramping-load
description: ramp to 50 VUs, hold 5m, ramp down

defaults:
  http:
    base_url: https://test.example.com
    headers:
      User-Agent: loadr/0.1 (ramp test)

scenarios:
  browse:
    executor: ramping-vus
    start_vus: 0
    stages:
      - { duration: 2m, target: 50 }   # ramp up
      - { duration: 5m, target: 50 }   # hold
      - { duration: 1m, target: 0 }    # ramp down
    graceful_ramp_down: 15s
    think_time: { type: uniform, min: 1s, max: 4s }
    flow:
      - request:
          name: home
          url: /
          checks: [ { type: status, equals: 200 } ]
      - request:
          name: products
          url: /products
          checks: [ { type: status, equals: 200 } ]

thresholds:
  http_req_duration: [ "p(95)<500", "p(99)<1200" ]
  http_req_failed: [ "rate<0.01" ]
