Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Canread
Gopsutil
提交
1a820b9a
G
Gopsutil
项目概览
Canread
/
Gopsutil
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gopsutil
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1a820b9a
编写于
4月 29, 2014
作者:
W
WAKAYAMA Shirou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add args which same as psutil. but has not implemented yet.
上级
5c8c707d
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
14 addition
and
14 deletion
+14
-14
cpu.go
cpu.go
+1
-1
cpu_freebsd.go
cpu_freebsd.go
+1
-1
cpu_linux.go
cpu_linux.go
+1
-1
cpu_test.go
cpu_test.go
+2
-2
cpu_windows.go
cpu_windows.go
+1
-1
disk_freebsd.go
disk_freebsd.go
+1
-1
disk_linux.go
disk_linux.go
+1
-1
disk_test.go
disk_test.go
+1
-1
disk_windows.go
disk_windows.go
+1
-1
process_freebsd.go
process_freebsd.go
+1
-1
process_linux.go
process_linux.go
+1
-1
process_test.go
process_test.go
+1
-1
process_windows.go
process_windows.go
+1
-1
未找到文件。
cpu.go
浏览文件 @
1a820b9a
...
...
@@ -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
}
cpu_freebsd.go
浏览文件 @
1a820b9a
...
...
@@ -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"
)
...
...
cpu_linux.go
浏览文件 @
1a820b9a
...
...
@@ -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"
...
...
cpu_test.go
浏览文件 @
1a820b9a
...
...
@@ -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
)
}
...
...
cpu_windows.go
浏览文件 @
1a820b9a
...
...
@@ -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
...
...
disk_freebsd.go
浏览文件 @
1a820b9a
...
...
@@ -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
...
...
disk_linux.go
浏览文件 @
1a820b9a
...
...
@@ -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
...
...
disk_test.go
浏览文件 @
1a820b9a
...
...
@@ -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
)
}
...
...
disk_windows.go
浏览文件 @
1a820b9a
...
...
@@ -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
(
...
...
process_freebsd.go
浏览文件 @
1a820b9a
...
...
@@ -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"
)
}
...
...
process_linux.go
浏览文件 @
1a820b9a
...
...
@@ -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"
)
...
...
process_test.go
浏览文件 @
1a820b9a
...
...
@@ -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
)
}
...
...
process_windows.go
浏览文件 @
1a820b9a
...
...
@@ -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"
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录