Use the DELTA() macro to tidy the server-side interval stats code a bit.

MFC after:	2 weeks
This commit is contained in:
jhb 2014-02-05 14:44:59 +00:00
parent c9c7c29042
commit f39931d6d5

View File

@ -1025,24 +1025,15 @@ exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly)
if (serverOnly) {
printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
((clientOnly && serverOnly) ? "Server:" : ""),
nfsstats.srvrpccnt[NFSV4OP_GETATTR] -
lastst.srvrpccnt[NFSV4OP_GETATTR],
nfsstats.srvrpccnt[NFSV4OP_LOOKUP] -
lastst.srvrpccnt[NFSV4OP_LOOKUP],
nfsstats.srvrpccnt[NFSV4OP_READLINK] -
lastst.srvrpccnt[NFSV4OP_READLINK],
nfsstats.srvrpccnt[NFSV4OP_READ] -
lastst.srvrpccnt[NFSV4OP_READ],
nfsstats.srvrpccnt[NFSV4OP_WRITE] -
lastst.srvrpccnt[NFSV4OP_WRITE],
nfsstats.srvrpccnt[NFSV4OP_RENAME] -
lastst.srvrpccnt[NFSV4OP_RENAME],
nfsstats.srvrpccnt[NFSV4OP_ACCESS] -
lastst.srvrpccnt[NFSV4OP_ACCESS],
(nfsstats.srvrpccnt[NFSV4OP_READDIR] -
lastst.srvrpccnt[NFSV4OP_READDIR]) +
(nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] -
lastst.srvrpccnt[NFSV4OP_READDIRPLUS]));
DELTA(srvrpccnt[NFSV4OP_GETATTR]),
DELTA(srvrpccnt[NFSV4OP_LOOKUP]),
DELTA(srvrpccnt[NFSV4OP_READLINK]),
DELTA(srvrpccnt[NFSV4OP_READ]),
DELTA(srvrpccnt[NFSV4OP_WRITE]),
DELTA(srvrpccnt[NFSV4OP_RENAME]),
DELTA(srvrpccnt[NFSV4OP_ACCESS]),
DELTA(srvrpccnt[NFSV4OP_READDIR]) +
DELTA(srvrpccnt[NFSV4OP_READDIRPLUS]));
printf("\n");
}
lastst = nfsstats;