config:

  target: https://api.unkey.dev
  phases:
    - name: Ramp up
      duration: 5m
      arrivalRate: 1
      rampTo: 10
    - name: Sustain
      duration: 5m
      arrivalRate: 10
      rampTo: 10
    - name: Spike Up
      duration: 1m
      arrivalRate: 10
      rampTo: 100
    - name: Spike Down
      duration: 1m
      arrivalRate: 100
      rampTo: 0
  
  # Load & configure a couple of useful plugins
  # https://docs.art/reference/extensions
  plugins:
    ensure: {}
    expect: {}

  ensure:
      thresholds:
        - http.response_time.p50: 25
        - http.response_time.p90: 100
        - http.response_time.p99: 300

scenarios:
  - flow:
      - post:
          url: "/v1/keys.verifyKey"
          json:
            key: "{{ $env.UNKEY_KEY }}"
          capture:
            - json: "$.valid"
              as: valid
          expect:
            - statusCode: 200
            - contentType: json
            - hasProperty: valid
            - equals:
              - "true"
              - "{{ valid }}"
