# Load & stress test simulation




An image

# Virtual performance environment

The load and stress test environment simulates a realistic payload of virtual requests to a specific server. As we can see below we are simulating an arrival (payload) of virtual users in order to guage the amount of traffic our application can take. The below example simulates two requests for a duration of two seconds which will then ramp up to a total of four requests for four seconds. We are testing the security of the application by targeting the "/genres" endpoint and inserting random strings and numbers by GET and POST requests. Lastly, we're expecting the requests to fail and receive a status code 400 per request.

config:
  plugins:
    fuzzer: {}
  target: 'http://localhost:3000'
  phases:
    - duration: 2
      arrivalRate: 2
      rampTo: 4
      name: 'Warming up the app'
    - duration: 4
      arrivalRate: 4
      name: 'Max load'
scenarios:
  - flow:
      - get:
          url: '/genres-{{ naughtyString }}'
          expect:
            - statusCode: 400
      - post:
          url: '/genres'
          json:
            id: ''
            name: '{{ naughtyString }}' #Creates random characters (Monkey testing endpoint)
          expect:
            - statusCode: 400
# can use faker as payload