Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
49c3c6c6
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,体验更适合开发者的 AI 搜索 >>
提交
49c3c6c6
编写于
7月 19, 2015
作者:
N
Nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IRIX mode off implementation (issue#628)
上级
c9df26a2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
2 deletion
+37
-2
docs/glances-doc.rst
docs/glances-doc.rst
+4
-0
glances/core/glances_main.py
glances/core/glances_main.py
+2
-0
glances/outputs/glances_curses.py
glances/outputs/glances_curses.py
+3
-0
glances/plugins/glances_help.py
glances/plugins/glances_help.py
+3
-0
glances/plugins/glances_processcount.py
glances/plugins/glances_processcount.py
+2
-0
glances/plugins/glances_processlist.py
glances/plugins/glances_processlist.py
+17
-2
man/glances.1
man/glances.1
+6
-0
未找到文件。
docs/glances-doc.rst
浏览文件 @
49c3c6c6
...
...
@@ -200,6 +200,7 @@ Command-Line Options
-f PROCESS_FILTER, --process-filter PROCESS_FILTER
set the process filter pattern (regular expression)
--process-short-name force short name for processes name
--disable-irix Task's cpu usage will be divided by the total number of CPUs
--hide-kernel-threads
hide kernel threads in process list
--tree display processes as a tree
...
...
@@ -271,6 +272,8 @@ The following commands (key pressed) are supported while in Glances:
Delete finished warning and critical log messages
``z``
Show/hide processes stats
``0``
Task's cpu usage will be divided by the total number of CPUs
``1``
Switch between global CPU and per-CPU stats
``2``
...
...
@@ -604,6 +607,7 @@ The number of processes in the list is adapted to the screen size.
``CPU%``
% of CPU used by the process
If IRIX mode is off (aka Solaris mode), the value is divided by logical core number
``MEM%``
% of MEM used by the process
``VIRT``
...
...
glances/core/glances_main.py
浏览文件 @
49c3c6c6
...
...
@@ -180,6 +180,8 @@ Start the client browser (browser mode):\n\
dest
=
'process_filter'
,
help
=
'set the process filter pattern (regular expression)'
)
parser
.
add_argument
(
'--process-short-name'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'process_short_name'
,
help
=
'force short name for processes name'
)
parser
.
add_argument
(
'--disable-irix'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'disable_irix'
,
help
=
'Task
\'
s cpu usage will be divided by the total number of CPUs'
)
if
not
is_windows
:
parser
.
add_argument
(
'--hide-kernel-threads'
,
action
=
'store_true'
,
default
=
False
,
dest
=
'no_kernel_threads'
,
help
=
'hide kernel threads in process list'
)
...
...
glances/outputs/glances_curses.py
浏览文件 @
49c3c6c6
...
...
@@ -252,6 +252,9 @@ class _GlancesCurses(object):
elif
self
.
pressedkey
==
10
:
# 'ENTER' > Edit the process filter
self
.
edit_filter
=
not
self
.
edit_filter
elif
self
.
pressedkey
==
ord
(
'0'
):
# '0' > Switch between IRIX and Solaris mode
self
.
args
.
disable_irix
=
not
self
.
args
.
disable_irix
elif
self
.
pressedkey
==
ord
(
'1'
):
# '1' > Switch between CPU and PerCPU information
self
.
args
.
percpu
=
not
self
.
args
.
percpu
...
...
glances/plugins/glances_help.py
浏览文件 @
49c3c6c6
...
...
@@ -88,6 +88,7 @@ class Plugin(GlancesPlugin):
self
.
view_data
[
'quit'
]
=
msg_col2
.
format
(
'q'
,
'Quit (Esc and Ctrl-C also work)'
)
self
.
view_data
[
'enable_disable_top_extends_stats'
]
=
msg_col
.
format
(
'e'
,
'Enable/disable top extended stats'
)
self
.
view_data
[
'enable_disable_short_processname'
]
=
msg_col
.
format
(
'/'
,
'Enable/disable short processes name'
)
self
.
view_data
[
'enable_disable_irix'
]
=
msg_col
.
format
(
'0'
,
'Enable/disable Irix process CPU'
)
self
.
view_data
[
'enable_disable_docker'
]
=
msg_col2
.
format
(
'D'
,
'Enable/disable Docker stats'
)
self
.
view_data
[
'enable_disable_quick_look'
]
=
msg_col
.
format
(
'3'
,
'Enable/disable quick look plugin'
)
self
.
view_data
[
'show_hide_ip'
]
=
msg_col2
.
format
(
'I'
,
'Show/hide IP module'
)
...
...
@@ -162,6 +163,8 @@ class Plugin(GlancesPlugin):
ret
.
append
(
self
.
curse_new_line
())
ret
.
append
(
self
.
curse_add_line
(
self
.
view_data
[
'enable_disable_short_processname'
]))
ret
.
append
(
self
.
curse_new_line
())
ret
.
append
(
self
.
curse_add_line
(
self
.
view_data
[
'enable_disable_irix'
]))
ret
.
append
(
self
.
curse_new_line
())
ret
.
append
(
self
.
curse_new_line
())
...
...
glances/plugins/glances_processcount.py
浏览文件 @
49c3c6c6
...
...
@@ -126,6 +126,8 @@ class Plugin(GlancesPlugin):
msg
=
'sorted by {0}'
.
format
(
glances_processes
.
sort_key
)
ret
.
append
(
self
.
curse_add_line
(
msg
))
ret
[
-
1
][
"msg"
]
+=
", %s view"
%
(
"tree"
if
glances_processes
.
is_tree_enabled
()
else
"flat"
)
# if args.disable_irix:
# ret[-1]["msg"] += " - IRIX off"
# Return the message with decoration
return
ret
glances/plugins/glances_processlist.py
浏览文件 @
49c3c6c6
...
...
@@ -25,6 +25,7 @@ import os
from
datetime
import
timedelta
# Import Glances libs
from
glances.plugins.glances_core
import
Plugin
as
CorePlugin
from
glances.core.glances_globals
import
is_windows
from
glances.core.glances_processes
import
glances_processes
from
glances.plugins.glances_plugin
import
GlancesPlugin
...
...
@@ -61,6 +62,12 @@ class Plugin(GlancesPlugin):
# Trying to display proc time
self
.
tag_proc_time
=
True
# Call CorePlugin to get the core number (needed when not in IRIX mode / Solaris mode)
try
:
self
.
nb_log_core
=
CorePlugin
(
args
=
self
.
args
).
update
()[
"log"
]
except
Exception
:
self
.
nb_log_core
=
0
# Note: 'glances_processes' is already init in the glances_processes.py script
def
get_key
(
self
):
...
...
@@ -174,7 +181,10 @@ class Plugin(GlancesPlugin):
ret
=
[
self
.
curse_new_line
()]
# CPU
if
'cpu_percent'
in
p
and
p
[
'cpu_percent'
]
is
not
None
and
p
[
'cpu_percent'
]
!=
''
:
msg
=
'{0:>6.1f}'
.
format
(
p
[
'cpu_percent'
])
if
args
.
disable_irix
and
self
.
nb_log_core
!=
0
:
msg
=
'{0:>6.1f}'
.
format
(
p
[
'cpu_percent'
]
/
float
(
self
.
nb_log_core
))
else
:
msg
=
'{0:>6.1f}'
.
format
(
p
[
'cpu_percent'
])
ret
.
append
(
self
.
curse_add_line
(
msg
,
self
.
get_alert
(
p
[
'cpu_percent'
],
header
=
"cpu"
)))
else
:
...
...
@@ -393,7 +403,12 @@ class Plugin(GlancesPlugin):
sort_style
=
'SORT'
# Header
msg
=
'{0:>6}'
.
format
(
'CPU%'
)
if
args
.
disable_irix
and
0
<
self
.
nb_log_core
<
10
:
msg
=
'{0:>6}'
.
format
(
'CPU%/'
+
str
(
self
.
nb_log_core
))
elif
args
.
disable_irix
and
self
.
nb_log_core
!=
0
:
msg
=
'{0:>6}'
.
format
(
'CPU%/C'
)
else
:
msg
=
'{0:>6}'
.
format
(
'CPU%'
)
ret
.
append
(
self
.
curse_add_line
(
msg
,
sort_style
if
process_sort_key
==
'cpu_percent'
else
'DEFAULT'
))
msg
=
'{0:>6}'
.
format
(
'MEM%'
)
ret
.
append
(
self
.
curse_add_line
(
msg
,
sort_style
if
process_sort_key
==
'memory_percent'
else
'DEFAULT'
))
...
...
man/glances.1
浏览文件 @
49c3c6c6
...
...
@@ -145,6 +145,9 @@ set the process filter pattern (regular expression)
.B \-\-process-short-name
force short name for processes name
.TP
.B \-\-disable-irix
Task's cpu usage will be divided by the total number of CPUs
.TP
.B \-\-hide-kernel-threads
hide kernel threads in process list
.TP
...
...
@@ -246,6 +249,9 @@ Show/hide processes stats
.B z
Show/hide processes list (for low CPU consumption)
.TP
.B 0
Task's cpu usage will be divided by the total number of CPUs
.TP
.B 1
Switch between global CPU and per-CPU stats
.TP
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录