new to pstop – vmstat style stdout interface

In November last year I announced a program I wrote called pstop. I hope that some of you have tried it and found it useful. Certainly I know that colleagues and friends use it and it has proved helpful when trying to look inside MySQL to see what it is doing.

A recent suggestion provoked me to provide a slightly different interface to pstop, that is rather than show the output in a terminal-like top format, provide a line-based summary in a similar way to vmstat(8), pt-diskstats(1p) and other similar command line tools.  I have now incorporated some changes which allow this to be done. So if you want to see every few seconds which tables are generating most load, or which files have most I/O then this tool may be useful. Example output is shown below:

Hopefully this gives you an idea.  The --help option gives you more details. I have not yet paid much attention to the output and the output is not currently well suited for a tool to parse, so I think it’s likely I will need to provide a more machine readable --raw format option at a later stage.  That said feedback on what you want to see or patches are most welcome.

Published by

Simon J Mudd

Born in England, I now live in Spain, but spent a few years living in the Netherlands. I previously worked in banking (financial markets) both in IT and as a broker, but IT has always had a stronger influence. Now working at booking.com as a Senior Database Administrator. Other interests include photography, and travel. Simon is married, with two children and lives in Madrid.

3 thoughts on “new to pstop – vmstat style stdout interface”

  1. Have you considered calling it psstat and having two utilities in the same package?

    I like the idea of having a suite of p_s tools similar to sysstat. Under the hood, /proc and p_s are similar in concept, and need tools to aggregate them.

    1. Hi Morgan,

      I had considered checking if the filename is called psstat and making it behave differently. Some programs already to that.
      The current long option names are a bit unmanageable so I need to fix that, so yes it makes sense. So using a hard- or symlink to achieve that should be easy, or if not simply generating 2 binaries would work.

      So something like psstat <options> 2 10 might be a typical way to use the tool if I want to get 10 iterations with a 2 second delay.
      I need to think about this a little more but yes, perhaps that’s the right way forward.

  2. So in the end I did split these into 2 commands. As of v0.5.0 pstop has been split into 2 binaries named ps-top and ps-stats. The github.com repo has now been modified to reflect the name change (though the old url also works) and is now: https://github.com/sjmudd/ps-top. The commands can be found under cmd/ and the README.md has been modified to explain how to build / install etc.

Leave a Reply