Process list

Instead of a log file, you can use pt-query-digest to read queries from the process list:

shell> pt-query-digest --processlist h=localhost  --iterations 10 --run-time 1m -u <user> -p<pass>

run-time specifies how long each iteration should run. In the preceding example, the tool generates reports every minute for 10 minutes.

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.