0

I want to load test Influx, how do I replay the recent queries that were executed? I have not found anything meaningful on Google.

Bob
  • 130

1 Answers1

0

You can get queries with:

docker logs $MYCONTAINER --since "10m" |& grep -o -P "query=\K.+" | sed 's/^.//;s/.$//' > out.txt

And then execute them with:

cat out.txt | xargs -I _ docker run -t --rm influxdb:1.8-alpine influx -host MYHOST -port 8086 -username USER -password PASS -database DB -execute _

To measure the time spent for each query, on the influx box you can run

sudo strace -p $(pgrep influxd) -f -e write -t -s 512 |& grep "write(1,"

Explanation: strace listens for syscalls.

  • -f flag finds and hooks into any child processes.
  • -e listens to specific syscalls
  • -t shows timestamps
  • -s sets the numbers characters to display

With grep, we want to avoid the network syscalls, so we only look at the stdout file descriptor.

Bob
  • 130