9985f22f72a08e3002eab8112760e4d3649b06b9
[pstop.git] / README.md
1 ## pstop
2
3 pstop - a top-like program for MySQL
4
5 pstop is a program which collects information from MySQL 5.6+'s
6 performance_schema database and uses this information to display
7 server load in real-time. Data is shown by table or filename and
8 the metrics also show how this is split between select, insert,
9 update or delete activity.  User activity is now shown showing the
10 number of different hosts that connect with the same username and
11 the actiity of those users.
12
13 This program was started as a simple project to allow me to learn
14 go, which I'd been following for a while, but hadn't used in earnest.
15 This probably shows in the code so suggestions on improvement are
16 most welcome.
17
18 ### Installation
19
20 Install and update this go package with `go get -u github.com/sjmudd/pstop`
21
22 ### Configuration
23
24 Access to MySQL is currently via a defaults-file which is assumed
25 to be ~/.my.cnf. This should probably be made more configurable.
26 If you see a need for this please let me know.
27
28 ### Grants
29
30 Do not forget to ensure that the MySQL user you configure has access
31 to the performance_schema tables.
32
33 ### Screens
34
35 pstop has 5 different screens:
36 * Latency mode: order table activity by the time waiting to perform operations on them.
37 * Ops (operations) mode: order table activity by the number of operations MySQL performs on them.
38 * I/O mode: show where MySQL is spending it's time in file I/O.
39 * Locks mode: show order based on table locks
40 * User mode: show ordering based on how long users are running queries, or the number of connections they have to MySQL.
41
42 ### Keys
43
44 The following keys allow you to navigate around the different pstop displays or to change it's behaviour.
45
46 * h - gives you a help screen.
47 * - - reduce the poll interval by 1 second (minimum 1 second)
48 * + - increase the poll interval by 1 second
49 * q - quit
50 * t - toggle between showing the statistics since resetting pstop started or you explicitly reset them (with 'z') [REL] or showing the statistics as collected from MySQL [ABS].
51 * z - reset statistics. That is counters you see are relative to when you "reset" statistics.
52 * <tab> - change display modes between: latency, ops, file I/O, lock modes and user modes.
53 * left arrow - change to previous screen
54 * right arrow - change to next screen
55
56 ### See also
57
58 See also BUGS and NEW_FEATURES which describe things that probably
59 need looking at and screen_samples.txt which provides some sample
60 output from my own system.
61
62 ### Feedback
63
64 Feedback and patches welcome.
65
66 Simon J Mudd
67 <sjmudd@pobox.com>
68
69 ### Code Documenton
70 [godoc.org/github.com/sjmudd/pstop](http://godoc.org/github.com/sjmudd/pstop)