title: Interpreting data from /proc/[id]/mountstats or /proc/self/mountstats
body: <p>I would like to monitor the IOs of my NFS shares. There are plenty of programs which are interpreting the data within <code>/proc/[id]/mountstats</code> ([id] = id of nfs client/server) or <code>/proc/self/mountstats</code>. The problem is, these programs calculate some IO per second. This is very nice in the command line, but it is quite useless for my monitoring solution. So I want to interpret the counters of <code>mountstats</code> myself. My problem now is, that I need some documentation of <code>mountstats</code> for nfs v4.</p>
  
  <p>So far my search haven't brought up any useful.</p>
  
  <p>Thanks for your help</p>
  
  <p>sample output of /proc/self/mountstats on Ubuntu (nfs client):</p>
  
  <pre><code>...
  device IPADRESS:/mountpoint mounted on /mnt/mountpoint with fstype nfs4 statvers=1.0
      opts:   rw,vers=4,rsize=1048576,wsize=1048576,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,nointr,proto=tcp,timeo=600,retrans=2,sec=sys
      age:    77663
      caps:   caps=0x1e,wtmult=512,dtsize=4096,bsize=0,namelen=255
      nfsv4:  bm0=0xfdffbfff,bm1=0xf9be3e,acl=0x3
      sec:    flavor=1,pseudoflavor=1
      events: 1462723 25756220 1025148 1164028 1083099 2027020 31347107 1984730 279773 1915700 1346583 21077199 520498 31825 525298 39026 2180470 1083041 0 16822 990144 11011 0 0 0
      bytes:  46686144592 3990939437 0 0 30238687174 3759616491 7739053 1346583
      RPC iostats version: 1.0  p/v: 100003/4 (nfs)
      xprt:   tcp 852 1 2 0 0 11822378 11822377 0 17669710 13357205
      per-op statistics
              NULL: 0 0 0 0 0 0 0 0
              READ: 1950114 1950114 0 330348288 30355844804 105050 6678050 6907640
             WRITE: 911822 911822 0 3932410080 215189360 10653830 1472320 12211620
            COMMIT: 389509 389509 0 65718096 88808052 8060 253550 284360
              OPEN: 1168845 1168845 0 292577612 554554444 430040 628900 1229990
      OPEN_CONFIRM: 43 43 0 7048 2924 0 10 10
       OPEN_NOATTR: 0 0 0 0 0 0 0 0
      OPEN_DOWNGRADE: 54 54 0 9952 12744 90 0 120
             CLOSE: 1081161 1081161 0 191495392 255153996 201030 404620 767870
           SETATTR: 43303 43303 0 8753024 10046296 1060 25650 30380
            FSINFO: 2 2 0 268 184 0 0 0
             RENEW: 0 0 0 0 0 0 0 0
       SETCLIENTID: 0 0 0 0 0 0 0 0
      SETCLIENTID_CONFIRM: 0 0 0 0 0 0 0 0
              LOCK: 1140050 1140050 0 246277244 77523400 76270 326950 469890
             LOCKT: 1 1 0 188 52 0 0 0
             LOCKU: 1037895 1037895 0 187916912 70576860 18130 357530 441480
            ACCESS: 450451 450451 0 72511716 102702828 21440 222460 280950
           GETATTR: 1462724 1462724 0 224029496 310097488 21290 390910 485350
            LOOKUP: 2043380 2043380 0 361899452 532433688 18200 499200 585170
       LOOKUP_ROOT: 1 1 0 116 232 0 0 0
            REMOVE: 32356 32356 0 5953448 7765440 600 15450 18560
            RENAME: 20388 20388 0 5593088 9215376 510 7740 9750
              LINK: 537 537 0 132024 231984 0 220 270
           SYMLINK: 0 0 0 0 0 0 0 0
            CREATE: 999 999 0 227376 293140 30 650 830
          PATHCONF: 1 1 0 140 72 0 0 0
            STATFS: 2872 2872 0 419360 333152 580 3980 4880
          READLINK: 0 0 0 0 0 0 0 0
           READDIR: 82718 82718 0 14625720 118955760 770 48470 53310
       SERVER_CAPS: 3 3 0 400 264 0 0 0
       DELEGRETURN: 0 0 0 0 0 0 0 0
            GETACL: 0 0 0 0 0 0 0 0
            SETACL: 0 0 0 0 0 0 0 0
      FS_LOCATIONS: 0 0 0 0 0 0 0 0
   ...
  </code></pre>