summaryrefslogtreecommitdiffstats
path: root/tools/mountstats
Commit message (Collapse)AuthorAgeFilesLines
* nfsiostat: display NFS RPC queue time for mountstats and nfs-iostatRyan Doyle2017-10-301-2/+7
| | | | | | | | | Display the NFS queue statistics for mountstats and nfsiostat exported in /proc/self/mountstats. The RTT and total execution time is currently displayed but it's also useful displaying how long the task was queued for too Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Remove a shebangSteve Dickson2017-07-271-1/+1
| | | | | | | There might be an issue that the script is executed with unwanted version of <lang>. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: add pNFS READs and WRITEsScott Mayhew2016-09-221-0/+2
| | | | | | | | | These counters are already in /proc/self/mountstats but the mountstats program doesn't display them. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1377740
* mountstats: add missing v4.2 operationsScott Mayhew2015-12-111-1/+8
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: handle KeyError in accumulate_iostats()Scott Mayhew2015-12-111-1/+4
| | | | | | | | | | | | | | | | | | | | | This will prevent a backtrace like this from occurring in 'mountstats nfsstat' if a new NFSv4 operation is added to the kernel but not to the Nfsv4ops list in mountstats.py: Traceback (most recent call last): File "/sbin/mountstats", line 988, in <module> res = main() File "/sbin/mountstats", line 977, in main return args.func(args) File "/sbin/mountstats", line 792, in nfsstat_command v4stats.accumulate_iostats(acc_stats) File "/sbin/mountstats", line 566, in accumulate_iostats self.__rpc_data[op] = list(map(add, self.__rpc_data[op], new_stats.__rpc_data[op])) KeyError: 'SEEK' Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats.man: Remove a few bogus .R macrosScott Mayhew2015-09-161-4/+4
| | | | | | | | | | These have no effect on the rendering of the man page, but they do cause the following error if you try to pipe or redirect the output: `R' is a string (producing the registered sign), not a macro. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats.man: fixed typo in man pageSteve Dickson2015-08-101-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix the retrans counter output by the nfsstat commandScott Mayhew2015-06-031-1/+1
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Normalize the mountpoints passed on the command line.Scott Mayhew2015-03-041-3/+3
| | | | | | | | Normalize the mountpoints passed on the command line so that commands like 'mountstats /mnt/' succeed rather than fail. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix exit code handlingScott Mayhew2015-03-041-4/+7
| | | | | | | | | | | When I changed mountstats to use the argparse module, I neglected to make the subcommand functions return any values even though main() was looking for them. Also removed SystemExit from the except clause at the end of the program since it was causing the program to always exit with a status of 1. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fixed a few typos in the mountstats(8) manpageSteve Dickson2015-02-191-4/+4
| | | | | Acked-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Updated the mountstats(8) man page.Scott Mayhew2014-12-131-14/+128
| | | | | | | | Added documentation for the iostat and nfsstat sub-commands. Added documentation for all of the options that have recently been added. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Implement the nfsstat sub-commandScott Mayhew2014-12-131-3/+153
| | | | | | | Displays nfssstat-like statistics (client statistics only). Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -R/--raw to mountstats_commandScott Mayhew2014-12-131-4/+43
| | | | | | | | | This option displays the mountstats in raw format (i.e. in the same format as /proc/self/mountstats). It's intended to be used mainly with the -S/--since option. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Allow mountstats_command to take a variable number of mountpointsScott Mayhew2014-12-131-14/+34
| | | | | | | | | Allow the mountstats command to take a variable number of mountpoints (including none, in which case it will print stats for all NFS mountpoints it finds). Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix IndexError in __parse_nfs_lineScott Mayhew2014-12-131-2/+2
| | | | | | | | If __parse_nfs_line is is called on a line that has 'fstype nfsd', it'll raise an IndexError trying to parse a nonexistent statvers entry. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -S/--sinceScott Mayhew2014-12-131-13/+38
| | | | | | | | | | Add support for -S/--since to display the delta between a previous copy of /proc/self/mountstats and the current /proc/self/mountstats file. Can be combined with the -f option to show the statistics between two different points in time. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -f/--fileScott Mayhew2014-12-131-10/+21
| | | | | | | | Add support for the -f/--file option to allow parsing of data from an arbitrary file instead of /proc/self/mountstats. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make print_iostat_summary handle newly appearing mountsScott Mayhew2014-12-131-1/+1
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make the iostat sub-command output match that of nfs-iostat.pyScott Mayhew2014-12-131-43/+61
| | | | | | | Changes mostly lifted straight from nfs-iostat.py. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Convert existing option parsing to use the argparse moduleScott Mayhew2014-12-131-144/+110
| | | | | | | | | | | | | | Made mountstats, nfsstat, and iostat all subcommands (note that the nfsstat function is still unimplemented here). If no sub-command is given, then the mountstats sub-command will run by default (so any scripts that run older versions of the mountstats command will still work). Also removed the --start and --end options since all they do is throw exceptions. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Refactor compare_iostatsScott Mayhew2014-12-131-6/+19
| | | | | | | | | | Iterate over the newly added counters instead of using repeated assignment statements. Also compute the difference of every counter where it makes sense -- this will allow support for -S/--since to be implemented in the future. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Refactor __parse_nfs_line and __parse_rpc_lineScott Mayhew2014-12-131-69/+23
| | | | | | | | Iterate over the newly added counter lists instead of having a ton of assignment statements. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add lists of various countersScott Mayhew2014-12-131-0/+168
| | | | | | | | | | The NfsEventCounters and NfsByteCounters were lifted straight from nfs-iostat.py. Also added counters for the xprt line (for udp, tcp, and rdma) as well as for v3 and v4 NFS ops. These will allow for more compact code in a couple of places. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix up NFS event countersScott Mayhew2014-12-131-15/+18
| | | | | | | | | The event counters in the mountstats program aren't in sync with the event counters in the kernel. Removed syncinodes and added vfsupdatepage, vfssetattr, congestionwait, pnfsreads, and pnfswrites. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Sort RPC statistics by operation countChuck Lever2014-12-061-11/+14
| | | | | | | | | Sort the RPC statistics in descending order by operation count, so that the most frequently executed operation appears at the top of the listing (a la `top`). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix spurious I/O errorsChuck Lever2014-11-171-0/+4
| | | | | | | | | | | | | | | | | When running mountstats under "watch," occassionally the output shows "close failed in file object desctructor: sys.excepthook is missing" and the data display is messed up. This seems to be a common problem when Python script output is piped to another program. Ensure stdout/stderr is completely flushed before mountstats exits, and add an IOError exception handler to catch these exceptions gracefully. Solution suggested by: http://bugs.python.org/issue11380 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Don't display retrans stats unless there are re-xmitSigned-off-by: Chuck Lever2014-11-041-2/+5
| | | | | | | | Clean up display of RPC statistics by omitting retransmit statistics when there have been no retransmissions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix Python 3 compatibility of mountstats and nfs-iostatSlavek Kabrda2014-07-251-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* tools: use install -m instead of --modeAaro Koskinen2014-03-111-1/+1
| | | | | | | | Use install -m instead of--mode for better compatibility. E.g. busybox's install doesn't support the long option. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: fix python2.x supportWeston Andros Adamson2013-10-211-0/+2
| | | | | | | | | Commit b703eabe converted mountstats to using python3's print() function, but this doesn't work in python2.x without importing the print function from __future__. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make mountstats Python 3 compatibleBohuslav Kabrda2013-09-181-155/+155
| | | | | | | This will make mountstat run on Python 2.6, 2.7 and >= 3.0 Signed-off-by: Bohuslav Kabrda <bkabrda@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Breaks on 3.1 kernelsSteve Dickson2011-09-211-0/+9
| | | | | | | | | mountstats depend on all devices entries in /proc/self/mountstats to start with the word 'device'. With 3.1 kernels, NFS entries start with the actual device (i.e. server:/export) not the word 'device'. This change confused mountstats parsing. Signed-off-by: Steve Dickson <steved@redhat.com>
* pdate addres for Free Software FoundationNeilBrown2011-08-291-1/+2
| | | | | | | | | | | | License texts contain multiple address for FSF, some wrong. So update them and replace COPYING file with http://www.gnu.org/licenses/gpl-2.0.txt which has a few changes to preamble and commentary. Also remove extra COPYING file from utils/statd/ Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add in autoconf support for mountstats and nfsiostatsSteve Dickson2010-04-161-0/+13
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Introduce man page for the mountstats commandSteve Dickson2010-04-161-0/+32
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Updated both the mountstats and nfs-iostat scripts to used theChuck Lever2008-07-151-4/+4
| | | | | | | proper abbreviation for kilobytes per second (kB/s). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add RDMA as a supported transport for reporting theTom Talpey2008-06-231-0/+20
| | | | | | | | mountstats statistics Signed-off-by: Tom Talpey <tmt@netapp.com> Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* The "mountstats" utility is a Python program that extracts and displays NFSChuck Lever2008-06-231-0/+584
client performance information from /proc/self/mountstats. Note that if mountstats is named 'ms-nfsstat' or 'ms-iostat' it offers slightly different functionality. It needs two man pages and the install script should provide both commands by installing the script and providing the other command via a symlink. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>