MCPcopy Create free account
hub / github.com/prometheus/procfs / parseClientV4Stats

Function parseClientV4Stats

nfs/parse.go:179–255  ·  view source on GitHub ↗
(v []uint64)

Source from the content-addressed store, hash-verified

177}
178
179func parseClientV4Stats(v []uint64) (ClientV4Stats, error) {
180 values := int(v[0])
181 if len(v[1:]) != values {
182 return ClientV4Stats{}, fmt.Errorf("invalid ClientV4Stats line %v", v)
183 }
184
185 // This function currently supports mapping 59 NFS v4 client stats. Older
186 // kernels may emit fewer stats, so we must detect this and pad out the
187 // values to match the expected slice size.
188 if values < 59 {
189 newValues := make([]uint64, 60)
190 copy(newValues, v)
191 v = newValues
192 }
193
194 return ClientV4Stats{
195 Null: v[1],
196 Read: v[2],
197 Write: v[3],
198 Commit: v[4],
199 Open: v[5],
200 OpenConfirm: v[6],
201 OpenNoattr: v[7],
202 OpenDowngrade: v[8],
203 Close: v[9],
204 Setattr: v[10],
205 FsInfo: v[11],
206 Renew: v[12],
207 SetClientID: v[13],
208 SetClientIDConfirm: v[14],
209 Lock: v[15],
210 Lockt: v[16],
211 Locku: v[17],
212 Access: v[18],
213 Getattr: v[19],
214 Lookup: v[20],
215 LookupRoot: v[21],
216 Remove: v[22],
217 Rename: v[23],
218 Link: v[24],
219 Symlink: v[25],
220 Create: v[26],
221 Pathconf: v[27],
222 StatFs: v[28],
223 ReadLink: v[29],
224 ReadDir: v[30],
225 ServerCaps: v[31],
226 DelegReturn: v[32],
227 GetACL: v[33],
228 SetACL: v[34],
229 FsLocations: v[35],
230 ReleaseLockowner: v[36],
231 Secinfo: v[37],
232 FsidPresent: v[38],
233 ExchangeID: v[39],
234 CreateSession: v[40],
235 DestroySession: v[41],
236 Sequence: v[42],

Callers 1

ParseClientRPCStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…