Skip to content

Instantly share code, notes, and snippets.

@ian0371
Last active June 24, 2024 07:08
Show Gist options
  • Save ian0371/9cac2b38ed0137dd38864e14a9b9dbef to your computer and use it in GitHub Desktop.
Save ian0371/9cac2b38ed0137dd38864e14a9b9dbef to your computer and use it in GitHub Desktop.
debug trace RPS measurement
#!/bin/bash
i=156607361
EN=http://localhost:8551/
while true; do
i=$((i + 128))
start=$(printf '0x%x' "$i")
end=$(printf '0x%x' "$((i + 127))")
start_time=$(date +%s%N) # Capture start time in nanoseconds
cast rpc debug_traceBlockByNumberRange "$start" "$end" '{"tracer":"fastCallTracer"}' -r $EN > /dev/null
end_time=$(date +%s%N) # Capture end time in nanoseconds
elapsed_time=$(( (end_time - start_time) / 1000000 )) # Convert nanoseconds to milliseconds
echo "$i ($start): ${elapsed_time}ms"
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment