improvements phase: toy -> med
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
wrk.method = "POST"
|
||||
wrk.headers["Content-Type"] = "application/json"
|
||||
|
||||
function request()
|
||||
local body = '{"metric":"cpu_usage","timestamp":' .. os.time() .. ',"value":42.3}'
|
||||
return wrk.format(nil, "/metrics", nil, body)
|
||||
end
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
THREADS=${1:-4}
|
||||
CONNECTIONS=${2:-10}
|
||||
DURATION_SECS=${3:-30}
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
wrk -t"$THREADS" -c"$CONNECTIONS" -d"$DURATION_SECS"s -s "$SCRIPT_DIR/send.lua" http://localhost:3000
|
||||
@@ -23,7 +23,7 @@ cleanup() {
|
||||
echo "All workers stopped."
|
||||
}
|
||||
|
||||
trap cleanup SIGINT SIGTERM EXIT
|
||||
trap cleanup SIGINT SIGTERM
|
||||
|
||||
echo "Starting $THREADS workers with RATE=$RATE each..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user