nfsstat output bad visual design

Bug #660386 reported by gpk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
New
Undecided
Unassigned

Bug Description

The output from nfsstat is visually confusing. For instance, output from nfsstat -c:
Client nfs v3:
null getattr setattr lookup access readlink
0 0% 541 69% 8 1% 66 8% 36 4% 0 0%

It's all too easy to read "getattr" at 0% and setattr at 69%. (That's wrong, of course,
but it had me confused for 10 minutes until I looked at the source code.)
It's easy to see why it's confusing:
1) The corresponding counts and percentages are far apart (10 spaces or so)
2) The close visual pairings are a percentage and the _next_ count (1 space)
3) The labels are close to the wrong percentage and far from the right percentage.

A sensible user interface design would right-justify the counts, instead of left-justifying them.
That would lead to a count being close to the corresponding percentage. Then, one would
right-justify the labels to put them close to both numbers.

That involves simply deleting the minus signs in printf specifications in print_callstats in nfsstat.c
                        printf("%-13s", names[i+j]);
...
                        printf("%-8u%3llu%% ", info[i+j], pct);

Are there any bad side effects? Hard to say. It depends on how many people use the output
of nfsstats in scripts and how flexible their parsing is. Since the man page doesn't specify
a format, and people shouldn't depend on it too much. Also, all the information is available
in /proc/net/rpc/nfs so a sensible script *shouldn't* use nfsstat for information.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: nfs-common 1:1.2.2-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.34-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
Date: Thu Oct 14 09:33:16 2010
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.utf8
 SHELL=/bin/bash
SourcePackage: nfs-utils

Revision history for this message
gpk (gpk-kochanski) wrote :
Revision history for this message
gpk (gpk-kochanski) wrote :

The bug report is HTML-formatted, so it doesn't preserve the spacing of the nfsstat output.
It's much worse when you see it on a terminal.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.