Add "Contributing" section to README
[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 ### Installation
14
15 Install and update this go package with `go get -u github.com/sjmudd/pstop`
16
17 ### Configuration
18
19 Access to MySQL is currently via a defaults-file which is assumed
20 to be `~/.my.cnf`. This should probably be made more configurable.
21 If you see a need for this please let me know.
22
23 ### Grants
24
25 `pstop` needs `SELECT` access to `performance_schema` tables. It
26 will not run if access to the required tables is not available.
27
28 ### Screens
29
30 pstop has 5 different screens which get updated by default every second.
31 * Latency mode: order table activity by the time waiting to perform operations on them.
32 * Ops (operations) mode: order table activity by the number of operations MySQL performs on them.
33 * I/O mode: show where MySQL is spending it's time in file I/O.
34 * Locks mode: show order based on table locks
35 * User mode: show ordering based on how long users are running queries, or the number of connections they have to MySQL.
36
37 You can change the polling interval and switch between modes (see below).
38
39 ### Keys
40
41 The following keys allow you to navigate around the different pstop displays or to change it's behaviour.
42
43 * h - gives you a help screen.
44 * - - reduce the poll interval by 1 second (minimum 1 second)
45 * + - increase the poll interval by 1 second
46 * q - quit
47 * 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].
48 * z - reset statistics. That is counters you see are relative to when you "reset" statistics.
49 * <tab> - change display modes between: latency, ops, file I/O, lock modes and user modes.
50 * left arrow - change to previous screen
51 * right arrow - change to next screen
52
53 ### See also
54
55 See also:
56 * [BUGS](https://github.com/sjmudd/pstop/blob/master/BUGS) currently known issues
57 * [NEW_FEATURES](https://github.com/sjmudd/pstop/blob/master/NEW_FEATURES) which describe things that probably need looking at
58 * [screen_samples.txt](https://github.com/sjmudd/pstop/blob/master/screen_samples.txt) provides some sample output from my own system.
59
60 ### Contributing
61
62 This program was started as a simple project to allow me (Simon) to learn
63 go, which I'd been following for a while, but hadn't used in earnest.
64 This probably shows in the code so suggestions on improvement are
65 most welcome.
66
67 You may find "Contributing to Open Source Git Repositories in Go"
68 by Katrina Owen to be useful:
69 https://blog.splice.com/contributing-open-source-git-repositories-go/
70
71 ### Licensing
72
73 BSD 2-Clause License
74
75 ### Feedback
76
77 Feedback and patches welcome.
78
79 Simon J Mudd
80 <sjmudd@pobox.com>
81
82 ### Code Documenton
83 [godoc.org/github.com/sjmudd/pstop](http://godoc.org/github.com/sjmudd/pstop)