Skip to content

Instantly share code, notes, and snippets.

@eskadah
Forked from jeffweiss/post_message.lua
Created November 6, 2018 19:40
Show Gist options
  • Save eskadah/8ff1bdc6ece84fc22047f113bfd26ff5 to your computer and use it in GitHub Desktop.
Save eskadah/8ff1bdc6ece84fc22047f113bfd26ff5 to your computer and use it in GitHub Desktop.

Revisions

  1. Jeff Weiss created this gist Oct 4, 2015.
    5 changes: 5 additions & 0 deletions post_message.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    wrk.method = "POST"
    -- this assumes that we're sending to a html form endpoint with csrf protection disabled
    -- wrk.body and wrk.headers would be different if we were sending a JSON payload to a JSON API endpoing
    wrk.body = "message[body]=wat"
    wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
    1 change: 1 addition & 0 deletions run_load_test.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ./wrk -s post_message.lua -t20 -c100 -d30s --latency http://localhost:4000/documents/1/messages