diff --git a/cpu.go b/cpu.go index 83d2a97..943f35c 100644 --- a/cpu.go +++ b/cpu.go @@ -19,6 +19,6 @@ type CPU_TimesStat struct { Stolen float32 `json:"stolen"` } -func Cpu_counts() (int, error) { +func Cpu_counts(logical bool) (int, error) { return runtime.NumCPU(), nil } diff --git a/cpu_freebsd.go b/cpu_freebsd.go index 06d8f4a..aeec136 100644 --- a/cpu_freebsd.go +++ b/cpu_freebsd.go @@ -22,7 +22,7 @@ const ( ) // TODO: get per cpus -func Cpu_times() ([]CPU_TimesStat, error) { +func Cpu_times(percpu bool) ([]CPU_TimesStat, error) { ret := make([]CPU_TimesStat, 0) cpu_time, err := do_sysctrl("kern.cp_time") diff --git a/cpu_linux.go b/cpu_linux.go index 674b9dc..60b612c 100644 --- a/cpu_linux.go +++ b/cpu_linux.go @@ -8,7 +8,7 @@ import ( "strings" ) -func Cpu_times() ([]CPU_TimesStat, error) { +func Cpu_times(percpu bool) ([]CPU_TimesStat, error) { ret := make([]CPU_TimesStat, 0) filename := "/proc/stat" diff --git a/cpu_test.go b/cpu_test.go index 8a66b68..bf5abfd 100644 --- a/cpu_test.go +++ b/cpu_test.go @@ -5,7 +5,7 @@ import ( ) func TestCpu_times(t *testing.T) { - v, err := Cpu_times() + v, err := Cpu_times(false) if err != nil { t.Errorf("error %v", err) } @@ -21,7 +21,7 @@ func TestCpu_times(t *testing.T) { } func TestCpu_counts(t *testing.T) { - v, err := Cpu_counts() + v, err := Cpu_counts(true) if err != nil { t.Errorf("error %v", err) } diff --git a/cpu_windows.go b/cpu_windows.go index ba88542..6f94aa8 100644 --- a/cpu_windows.go +++ b/cpu_windows.go @@ -7,7 +7,7 @@ import ( "unsafe" ) -func Cpu_times() ([]CPU_TimesStat, error) { +func Cpu_times(percpu bool) ([]CPU_TimesStat, error) { ret := make([]CPU_TimesStat, 0) var lpIdleTime FILETIME diff --git a/disk_freebsd.go b/disk_freebsd.go index 155446a..366bacb 100644 --- a/disk_freebsd.go +++ b/disk_freebsd.go @@ -7,7 +7,7 @@ import ( "unsafe" ) -func Disk_partitions() ([]Disk_partitionStat, error) { +func Disk_partitions(all bool) ([]Disk_partitionStat, error) { ret := make([]Disk_partitionStat, 0) // get length diff --git a/disk_linux.go b/disk_linux.go index e7e7827..ad7192d 100644 --- a/disk_linux.go +++ b/disk_linux.go @@ -2,7 +2,7 @@ package gopsutil -func Disk_partitions() ([]Disk_partitionStat, error) { +func Disk_partitions(all bool) ([]Disk_partitionStat, error) { ret := make([]Disk_partitionStat, 0) return ret, nil diff --git a/disk_test.go b/disk_test.go index eb0453b..f7dfd68 100644 --- a/disk_test.go +++ b/disk_test.go @@ -21,7 +21,7 @@ func TestDisk_usage(t *testing.T) { } func TestDisk_partitions(t *testing.T) { - v, err := Disk_partitions() + v, err := Disk_partitions(false) if err != nil { t.Errorf("error %v", err) } diff --git a/disk_windows.go b/disk_windows.go index 133eb39..8547155 100644 --- a/disk_windows.go +++ b/disk_windows.go @@ -44,7 +44,7 @@ func Disk_usage(path string) (Disk_usageStat, error) { return ret, nil } -func Disk_partitions() ([]Disk_partitionStat, error) { +func Disk_partitions(all bool) ([]Disk_partitionStat, error) { ret := make([]Disk_partitionStat, 0) lpBuffer := make([]byte, 254) diskret, _, err := procGetLogicalDriveStringsW.Call( diff --git a/process_freebsd.go b/process_freebsd.go index ab88e36..bca182b 100644 --- a/process_freebsd.go +++ b/process_freebsd.go @@ -127,7 +127,7 @@ func (p *Process) Connections() ([]Net_connectionStat, error) { func (p *Process) Is_running() (bool, error) { return true, errors.New("Not implemented yet") } -func (p *Process) Memory_Maps() (*[]Memory_mapsStat, error) { +func (p *Process) Memory_Maps(grouped bool) (*[]Memory_mapsStat, error) { ret := make([]Memory_mapsStat, 0) return &ret, errors.New("Not implemented yet") } diff --git a/process_linux.go b/process_linux.go index 285a52b..a8b6fb2 100644 --- a/process_linux.go +++ b/process_linux.go @@ -188,7 +188,7 @@ func (p *Process) Is_running() (bool, error) { } // Get memory maps from /proc/(pid)/smaps -func (p *Process) Memory_Maps() (*[]Memory_mapsStat, error) { +func (p *Process) Memory_Maps(grouped bool) (*[]Memory_mapsStat, error) { pid := p.Pid ret := make([]Memory_mapsStat, 0) smapsPath := filepath.Join("/", "proc", strconv.Itoa(int(pid)), "smaps") diff --git a/process_test.go b/process_test.go index f18b4ff..d58d1de 100644 --- a/process_test.go +++ b/process_test.go @@ -57,7 +57,7 @@ func Test_Process_memory_maps(t *testing.T) { return ret, err := NewProcess(int32(check_pid)) - mmaps, err := ret.Memory_Maps() + mmaps, err := ret.Memory_Maps(false) if err != nil { t.Errorf("memory map get error %v", err) } diff --git a/process_windows.go b/process_windows.go index b6a8ceb..50a2555 100644 --- a/process_windows.go +++ b/process_windows.go @@ -160,7 +160,7 @@ func (p *Process) Is_running() (bool, error) { return true, errors.New("Not implemented yet") } -func (p *Process) Memory_Maps() (*[]Memory_mapsStat, error) { +func (p *Process) Memory_Maps(grouped bool) (*[]Memory_mapsStat, error) { return nil, errors.New("Not implemented yet") }