# Raw socket load: TCP request/response and UDP datagrams, with hex payloads.
name: raw-sockets
description: TCP and UDP round trips

scenarios:
  tcp_echo:
    executor: constant-vus
    vus: 10
    duration: 1m
    flow:
      - request:
          name: tcp ping
          url: tcp://echo.example.com:7000
          socket:
            send_text: "PING ${vu}\n"
            read_bytes: 64
            read_timeout: 2s
          checks:
            - { type: body_contains, value: PONG }

  udp_metrics:
    executor: constant-arrival-rate
    rate: 500
    duration: 1m
    pre_allocated_vus: 20
    flow:
      - request:
          name: udp probe
          url: udp://stats.example.com:8125
          socket:
            send_hex: "deadbeef 0102 0304"
            read_timeout: 500ms

thresholds:
  tcp_req_duration: [ "p(99)<50" ]
