Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
3796c3ca
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3796c3ca
编写于
8月 21, 2021
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Incorrect processes disk IO stats #1922
上级
a43f24af
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
31 deletion
+19
-31
glances/plugins/glances_processlist.py
glances/plugins/glances_processlist.py
+19
-31
未找到文件。
glances/plugins/glances_processlist.py
浏览文件 @
3796c3ca
...
...
@@ -327,49 +327,35 @@ class Plugin(GlancesPlugin):
ret
=
self
.
curse_add_line
(
msg
)
return
ret
def
_get_process_curses_io
_read
(
self
,
p
,
selected
,
args
):
"""Return process IO Read curses"""
def
_get_process_curses_io
(
self
,
p
,
selected
,
args
,
rorw
=
'ior'
):
"""Return process IO Read
or Write
curses"""
ret
=
''
if
'io_counters'
in
p
and
\
p
[
'io_counters'
][
4
]
==
1
and
\
p
[
'time_since_update'
]
!=
0
:
# Display rate if stats is available and io_tag ([4]) == 1
# IO
read
io
_rs
=
int
((
p
[
'io_counters'
][
0
]
-
p
[
'io_counters'
]
[
2
])
/
p
[
'time_since_update'
])
if
io
_rs
==
0
:
msg
=
self
.
layout_stat
[
'ior'
].
format
(
"0"
)
# IO
io
=
int
((
p
[
'io_counters'
][
0
if
rorw
==
'ior'
else
1
]
-
p
[
'io_counters'
]
[
2
if
rorw
==
'ior'
else
3
])
/
p
[
'time_since_update'
])
if
io
==
0
:
msg
=
self
.
layout_stat
[
rorw
].
format
(
"0"
)
else
:
msg
=
self
.
layout_stat
[
'ior'
].
format
(
self
.
auto_unit
(
io
_rs
,
msg
=
self
.
layout_stat
[
rorw
].
format
(
self
.
auto_unit
(
io
,
low_precision
=
True
))
ret
=
self
.
curse_add_line
(
msg
,
optional
=
True
,
additional
=
True
)
else
:
msg
=
self
.
layout_header
[
'ior'
].
format
(
"?"
)
msg
=
self
.
layout_header
[
rorw
].
format
(
"?"
)
ret
=
self
.
curse_add_line
(
msg
,
optional
=
True
,
additional
=
True
)
return
ret
def
_get_process_curses_io_read
(
self
,
p
,
selected
,
args
):
"""Return process IO Read curses"""
return
self
.
_get_process_curses_io
(
p
,
selected
,
args
,
rorw
=
'ior'
)
def
_get_process_curses_io_write
(
self
,
p
,
selected
,
args
):
"""Return process IO Write curses"""
ret
=
''
if
'io_counters'
in
p
and
\
p
[
'io_counters'
][
4
]
==
1
and
\
p
[
'time_since_update'
]
!=
0
:
# Display rate if stats is available and io_tag ([4]) == 1
# IO read
io_ws
=
int
((
p
[
'io_counters'
][
0
]
-
p
[
'io_counters'
]
[
2
])
/
p
[
'time_since_update'
])
if
io_ws
==
0
:
msg
=
self
.
layout_stat
[
'iow'
].
format
(
"0"
)
else
:
msg
=
self
.
layout_stat
[
'iow'
].
format
(
self
.
auto_unit
(
io_ws
,
low_precision
=
True
))
ret
=
self
.
curse_add_line
(
msg
,
optional
=
True
,
additional
=
True
)
else
:
msg
=
self
.
layout_header
[
'iow'
].
format
(
"?"
)
ret
=
self
.
curse_add_line
(
msg
,
optional
=
True
,
additional
=
True
)
return
ret
return
self
.
_get_process_curses_io
(
p
,
selected
,
args
,
rorw
=
'iow'
)
def
get_process_curses_data
(
self
,
p
,
selected
,
args
):
"""Get curses data to display for a process.
...
...
@@ -662,7 +648,8 @@ class Plugin(GlancesPlugin):
# IO read/write
if
'io_counters'
in
self
.
stats
[
0
]
and
mmm
is
None
:
# IO read
io_rs
=
int
((
self
.
__sum_stats
(
'io_counters'
,
0
)
-
self
.
__sum_stats
(
'io_counters'
,
indice
=
2
,
mmm
=
mmm
))
/
self
.
stats
[
0
][
'time_since_update'
])
io_rs
=
int
((
self
.
__sum_stats
(
'io_counters'
,
0
)
-
self
.
__sum_stats
(
'io_counters'
,
indice
=
2
,
mmm
=
mmm
))
/
self
.
stats
[
0
][
'time_since_update'
])
if
io_rs
==
0
:
msg
=
self
.
layout_stat
[
'ior'
].
format
(
'0'
)
else
:
...
...
@@ -671,7 +658,8 @@ class Plugin(GlancesPlugin):
decoration
=
self
.
__mmm_deco
(
mmm
),
optional
=
True
,
additional
=
True
))
# IO write
io_ws
=
int
((
self
.
__sum_stats
(
'io_counters'
,
1
)
-
self
.
__sum_stats
(
'io_counters'
,
indice
=
3
,
mmm
=
mmm
))
/
self
.
stats
[
0
][
'time_since_update'
])
io_ws
=
int
((
self
.
__sum_stats
(
'io_counters'
,
1
)
-
self
.
__sum_stats
(
'io_counters'
,
indice
=
3
,
mmm
=
mmm
))
/
self
.
stats
[
0
][
'time_since_update'
])
if
io_ws
==
0
:
msg
=
self
.
layout_stat
[
'iow'
].
format
(
'0'
)
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录