-
Notifications
You must be signed in to change notification settings - Fork 21
/
mounts.go
113 lines (99 loc) · 3.85 KB
/
mounts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package client
type MountResponse struct {
Mounts []Mount `json:"mounts"`
}
type Mount struct {
Device string `json:"device"`
Mount string `json:"mount"`
Export string `json:"export"`
Options map[string]string `json:"options"`
}
type MountStatsResponse struct {
Mounts []MountStats `json:"mounts"`
}
type MountStats struct {
Device string `json:"device"`
Mount string `json:"mount"`
Export string `json:"export"`
Options map[string]string `json:"options"`
Stats NFSMountStats `json:"stats"`
}
type NFSMountStats struct {
Age Duration `json:"age"`
Bytes NFSByteStats `json:"bytes"`
Events NFSEventStats `json:"events"`
Operations []NFSOperationStats `json:"operations"`
}
type NFSByteStats struct {
NormalRead uint64 `json:"normalRead"`
NormalWrite uint64 `json:"normalWrite"`
DirectRead uint64 `json:"directRead"`
DirectWrite uint64 `json:"directWrite"`
ServerRead uint64 `json:"serverRead"`
ServerWrite uint64 `json:"serverWrite"`
ReadPages uint64 `json:"readPages"`
WritePages uint64 `json:"writePages"`
}
type NFSEventStats struct {
InodeRevalidate uint64 `json:"inodeRevalidate"`
DnodeRevalidate uint64 `json:"dnodeRevalidate"`
DataInvalidate uint64 `json:"dataInvalidate"`
AttributeInvalidate uint64 `json:"attributeInvalidate"`
VFSOpen uint64 `json:"vfsOpen"`
VFSLookup uint64 `json:"vfsLookup"`
VFSAccess uint64 `json:"vfsAccess"`
VFSUpdatePage uint64 `json:"vfsUpdatePage"`
VFSReadPage uint64 `json:"vfsReadPage"`
VFSReadPages uint64 `json:"vfsReadPages"`
VFSWritePage uint64 `json:"vfsWritePage"`
VFSWritePages uint64 `json:"vfsWritePages"`
VFSGetdents uint64 `json:"vfsGetdents"`
VFSSetattr uint64 `json:"vfsSetattr"`
VFSFlush uint64 `json:"vfsFlush"`
VFSFsync uint64 `json:"vfsFsync"`
VFSLock uint64 `json:"vfsLock"`
VFSFileRelease uint64 `json:"vfsFileRelease"`
Truncation uint64 `json:"truncation"`
WriteExtension uint64 `json:"writeExtension"`
SillyRename uint64 `json:"sillyRename"`
ShortRead uint64 `json:"shortRead"`
ShortWrite uint64 `json:"shortWrite"`
Delay uint64 `json:"delay"`
PNFSRead uint64 `json:"pnfsRead"`
PNFSWrite uint64 `json:"pnfsWrite"`
}
type NFSOperationStats struct {
Operation string `json:"operation"`
Requests uint64 `json:"requests"`
Transmissions uint64 `json:"transmissions"`
Retries uint64 `json:"retries"`
MajorTimeouts uint64 `json:"majorTimeouts"`
BytesSent uint64 `json:"bytesSent"`
BytesReceived uint64 `json:"bytesReceived"`
QueueMilliseconds uint64 `json:"queueMilliseconds"`
RTTMilliseconds uint64 `json:"rttMilliseconds"`
ExecutionMilliseconds uint64 `json:"executionMilliseconds"`
Errors uint64 `json:"errors"`
}
func (c *KnfsdAgentClient) GetMounts() (*MountResponse, error) {
var v *MountResponse
err := c.get("api/v1/mounts", &v)
return v, err
}
func (c *KnfsdAgentClient) GetMountStats() (*MountStatsResponse, error) {
var v *MountStatsResponse
err := c.get("api/v1/mountStats", &v)
return v, err
}