func readNFSClientIOTotal()

in image/resources/knfsd-agent/nfs.go [170:190]


func readNFSClientIOTotal(proc procfs.Proc, nfsRoot string) (client.NFSIO, error) {
	s, err := proc.MountStats()
	if err != nil {
		return client.NFSIO{}, err
	}

	var io client.NFSIO
	for _, m := range s {
		if !isNFS(m.Type) {
			continue
		}
		if !strings.HasPrefix(m.Mount, nfsRoot) {
			continue
		}
		if s, ok := m.Stats.(*procfs.MountStatsNFS); ok {
			io.Read += s.Bytes.ReadTotal
			io.Write += s.Bytes.WriteTotal
		}
	}
	return io, nil
}