Merge branch 'master' of github.com:shirou/gopsutil

This commit is contained in:
Shirou WAKAYAMA 2014-05-20 19:30:06 +09:00
commit 11569147c0
1 changed files with 6 additions and 6 deletions

View File

@ -6,26 +6,26 @@ import (
"strconv"
)
func LoadAvg() (LoadAvgStat, error) {
func LoadAvg() (*LoadAvgStat, error) {
values, err := doSysctrl("vm.loadavg")
if err != nil {
return LoadAvgStat{}, err
return nil, err
}
load1, err := strconv.ParseFloat(values[0], 64)
if err != nil {
return LoadAvgStat{}, err
return nil, err
}
load5, err := strconv.ParseFloat(values[1], 64)
if err != nil {
return LoadAvgStat{}, err
return nil, err
}
load15, err := strconv.ParseFloat(values[2], 64)
if err != nil {
return LoadAvgStat{}, err
return nil, err
}
ret := LoadAvgStat{
ret := &LoadAvgStat{
Load1: float64(load1),
Load5: float64(load5),
Load15: float64(load15),