Send time as data message in artillery.io

26 Views Asked by At

I have neediness of using current time (or datetime) in artillery.io test. I want to test current time as a message:

config:
  target: "http://localhost:3000/"
  phases:
    - duration: 10 
      arrivalRate: 1
  environments:
    local:
      target: "http://localhost:3000/"
      phases:
        - duration: 10
          arrivalRate: 1
    prod:
      target: "http://localhost:3000/"
      phases:
        - duration: 100
          arrivalRate: 1 
          
scenarios:
  - name: "Emit an event"
    engine: socketio
    flow:
      - loop:
          - emit:
              channel: "chat
               message"
              data: " messageWithTime "
          - think: 1
        count: "{{ count }}" 

where data: " messageWithTime " there should be current time. I cannot pass time as a variable during executing command, because i need to have current time in each request. Is it possible?

0

There are 0 best solutions below