summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go')
-rw-r--r--vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go127
1 files changed, 126 insertions, 1 deletions
diff --git a/vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go b/vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go
index d821f1b4c..afe3db47e 100644
--- a/vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go
+++ b/vendor/github.com/prometheus/procfs/nfs/parse_nfs_test.go
@@ -21,7 +21,7 @@ import (
"github.com/prometheus/procfs/nfs"
)
-func TestNewNFSdClientRPCStats(t *testing.T) {
+func TestNewNFSClientRPCStats(t *testing.T) {
tests := []struct {
name string
content string
@@ -33,6 +33,131 @@ func TestNewNFSdClientRPCStats(t *testing.T) {
content: "invalid",
invalid: true,
}, {
+ name: "good old kernel version file",
+ content: `net 70 70 69 45
+rpc 1218785755 374636 1218815394
+proc2 18 16 57 74 52 71 73 45 86 0 52 83 61 17 53 50 23 70 82
+proc3 22 0 1061909262 48906 4077635 117661341 5 29391916 2570425 2993289 590 0 0 7815 15 1130 0 3983 92385 13332 2 1 23729
+proc4 48 98 51 54 83 85 23 24 1 28 73 68 83 12 84 39 68 59 58 88 29 74 69 96 21 84 15 53 86 54 66 56 97 36 49 32 85 81 11 58 32 67 13 28 35 90 1 26 1337
+`,
+ stats: &nfs.ClientRPCStats{
+ Network: nfs.Network{
+ NetCount: 70,
+ UDPCount: 70,
+ TCPCount: 69,
+ TCPConnect: 45,
+ },
+ ClientRPC: nfs.ClientRPC{
+ RPCCount: 1218785755,
+ Retransmissions: 374636,
+ AuthRefreshes: 1218815394,
+ },
+ V2Stats: nfs.V2Stats{
+ Null: 16,
+ GetAttr: 57,
+ SetAttr: 74,
+ Root: 52,
+ Lookup: 71,
+ ReadLink: 73,
+ Read: 45,
+ WrCache: 86,
+ Write: 0,
+ Create: 52,
+ Remove: 83,
+ Rename: 61,
+ Link: 17,
+ SymLink: 53,
+ MkDir: 50,
+ RmDir: 23,
+ ReadDir: 70,
+ FsStat: 82,
+ },
+ V3Stats: nfs.V3Stats{
+ Null: 0,
+ GetAttr: 1061909262,
+ SetAttr: 48906,
+ Lookup: 4077635,
+ Access: 117661341,
+ ReadLink: 5,
+ Read: 29391916,
+ Write: 2570425,
+ Create: 2993289,
+ MkDir: 590,
+ SymLink: 0,
+ MkNod: 0,
+ Remove: 7815,
+ RmDir: 15,
+ Rename: 1130,
+ Link: 0,
+ ReadDir: 3983,
+ ReadDirPlus: 92385,
+ FsStat: 13332,
+ FsInfo: 2,
+ PathConf: 1,
+ Commit: 23729, },
+ ClientV4Stats: nfs.ClientV4Stats{
+ Null: 98,
+ Read: 51,
+ Write: 54,
+ Commit: 83,
+ Open: 85,
+ OpenConfirm: 23,
+ OpenNoattr: 24,
+ OpenDowngrade: 1,
+ Close: 28,
+ Setattr: 73,
+ FsInfo: 68,
+ Renew: 83,
+ SetClientId: 12,
+ SetClientIdConfirm: 84,
+ Lock: 39,
+ Lockt: 68,
+ Locku: 59,
+ Access: 58,
+ Getattr: 88,
+ Lookup: 29,
+ LookupRoot: 74,
+ Remove: 69,
+ Rename: 96,
+ Link: 21,
+ Symlink: 84,
+ Create: 15,
+ Pathconf: 53,
+ StatFs: 86,
+ ReadLink: 54,
+ ReadDir: 66,
+ ServerCaps: 56,
+ DelegReturn: 97,
+ GetAcl: 36,
+ SetAcl: 49,
+ FsLocations: 32,
+ ReleaseLockowner: 85,
+ Secinfo: 81,
+ FsidPresent: 11,
+ ExchangeId: 58,
+ CreateSession: 32,
+ DestroySession: 67,
+ Sequence: 13,
+ GetLeaseTime: 28,
+ ReclaimComplete: 35,
+ LayoutGet: 90,
+ GetDeviceInfo: 1,
+ LayoutCommit: 26,
+ LayoutReturn: 1337,
+ SecinfoNoName: 0,
+ TestStateId: 0,
+ FreeStateId: 0,
+ GetDeviceList: 0,
+ BindConnToSession: 0,
+ DestroyClientId: 0,
+ Seek: 0,
+ Allocate: 0,
+ DeAllocate: 0,
+ LayoutStats: 0,
+ Clone: 0,
+ },
+ },
+ }, {
name: "good file",
content: `net 18628 0 18628 6
rpc 4329785 0 4338291