We're trying to do some server performance debugging and I would like to capture a snapshot of the queries being run on our MySQL server over a period of a couple minutes.
I'm familiar with MySQL's
SHOW FULL PROCESSLIST, however I'd like to be able to run this via the command line so I can dump it to a file and post process it.
Is there a way to output this query to a file and have it run every second or so?
Is there a better way to capture all of the queries being run?
Note that I'm not interested in just the slow queries (I'm familiar with the slow query log).