|
|
@ -94,7 +94,7 @@ func Partitions(all bool) ([]PartitionStat, error) {
|
|
|
|
return ret, nil
|
|
|
|
return ret, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func IOCounters() (map[string]IOCountersStat, error) {
|
|
|
|
func IOCountersForNames(names []string) (map[string]IOCountersStat, error) {
|
|
|
|
// statinfo->devinfo->devstat
|
|
|
|
// statinfo->devinfo->devstat
|
|
|
|
// /usr/include/devinfo.h
|
|
|
|
// /usr/include/devinfo.h
|
|
|
|
ret := make(map[string]IOCountersStat)
|
|
|
|
ret := make(map[string]IOCountersStat)
|
|
|
@ -119,6 +119,10 @@ func IOCounters() (map[string]IOCountersStat, error) {
|
|
|
|
un := strconv.Itoa(int(d.Unit_number))
|
|
|
|
un := strconv.Itoa(int(d.Unit_number))
|
|
|
|
name := common.IntToString(d.Device_name[:]) + un
|
|
|
|
name := common.IntToString(d.Device_name[:]) + un
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(names) > 0 && !common.StringsHas(names, name) {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ds := IOCountersStat{
|
|
|
|
ds := IOCountersStat{
|
|
|
|
ReadCount: d.Operations[DEVSTAT_READ],
|
|
|
|
ReadCount: d.Operations[DEVSTAT_READ],
|
|
|
|
WriteCount: d.Operations[DEVSTAT_WRITE],
|
|
|
|
WriteCount: d.Operations[DEVSTAT_WRITE],
|
|
|
|