improvements phase: toy -> med

This commit is contained in:
2026-03-24 13:30:28 +00:00
parent 50846646f6
commit 89d7ad0021
6 changed files with 179 additions and 33 deletions
+7
View File
@@ -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
+11
View File
@@ -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
+1 -1
View File
@@ -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..."