Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
259dcd6d
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,发现更多精彩内容 >>
提交
259dcd6d
编写于
1月 17, 2018
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Nice Process Priority Configuration #1218
上级
141999bb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
9 deletion
+54
-9
NEWS
NEWS
+15
-0
conf/glances.conf
conf/glances.conf
+11
-0
docs/aoa/ps.rst
docs/aoa/ps.rst
+4
-2
docs/man/glances.1
docs/man/glances.1
+2
-2
glances/plugins/glances_processlist.py
glances/plugins/glances_processlist.py
+22
-5
未找到文件。
NEWS
浏览文件 @
259dcd6d
...
...
@@ -18,6 +18,7 @@ Enhancements and new features:
* Add a code of conduct for Glances project's participants #1211
* Context switches bottleneck identification #1212
* Take advantage of the PSUtil issue #1025 (Add process_iter(attrs, ad_value)) #1105
* Nice Process Priority Configuration #1218
Bugs corrected:
...
...
@@ -56,6 +57,20 @@ News command line options:
News configuration keys in the glances.conf file:
Processes list Nice value:
[processlist]
# Nice priorities range from -20 to 19.
# Configure nice levels using a comma separated list.
#
# Nice: Example 1, non-zero is warning (default behavior)
nice_warning=-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
#
# Nice: Example 2, low priority processes escalate from careful to critical
#nice_careful=1,2,3,4,5,6,7,8,9
#nice_warning=10,11,12,13,14
#nice_critical=15,16,17,18,19
Docker plugin (related to #1152)
[docker]
...
...
conf/glances.conf
浏览文件 @
259dcd6d
...
...
@@ -210,6 +210,17 @@ cpu_critical=90
mem_careful
=
50
mem_warning
=
70
mem_critical
=
90
#
# Nice priorities range from -20 to 19.
# Configure nice levels using a comma separated list.
#
# Nice: Example 1, non-zero is warning (default behavior)
nice_warning
=-
20
,-
19
,-
18
,-
17
,-
16
,-
15
,-
14
,-
13
,-
12
,-
11
,-
10
,-
9
,-
8
,-
7
,-
6
,-
5
,-
4
,-
3
,-
2
,-
1
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
#
# Nice: Example 2, low priority processes escalate from careful to critical
#nice_careful=1,2,3,4,5,6,7,8,9
#nice_warning=10,11,12,13,14
#nice_critical=15,16,17,18,19
[
ports
]
# Ports scanner plugin configuration
...
...
docs/aoa/ps.rst
浏览文件 @
259dcd6d
...
...
@@ -122,5 +122,7 @@ The extended stats feature can be enabled using the
(curses interface).
.. note::
Limit values can be overwritten in the configuration file under
the ``[process]`` section.
Limit for CPU and MEM percent values can be overwritten in the
configuration file under the ``[processlist]`` section. It is also
possible to define limit for Nice values (comma separated list).
For example: nice_warning=-20,-19,-18
docs/man/glances.1
浏览文件 @
259dcd6d
.\" Man page generated from reStructuredText.
.
.TH "GLANCES" "1" "
Dec 29, 2017
" "3.0_DEV" "Glances"
.TH "GLANCES" "1" "
Jan 17, 2018
" "3.0_DEV" "Glances"
.SH NAME
glances \- An eye on your system
.
...
...
@@ -847,6 +847,6 @@ $ glances \-\-browser
.sp
Nicolas Hennion aka Nicolargo <\fI\%contact@nicolargo.com\fP>
.SH COPYRIGHT
201
7
, Nicolas Hennion
201
8
, Nicolas Hennion
.\" Generated by docutils manpage writer.
.
glances/plugins/glances_processlist.py
浏览文件 @
259dcd6d
...
...
@@ -202,6 +202,26 @@ class Plugin(GlancesPlugin):
return
child_data
def
get_nice_alert
(
self
,
value
):
"""Return the alert relative to the Nice configuration list"""
value
=
str
(
value
)
try
:
if
value
in
self
.
get_limit
(
'nice_critical'
):
return
'CRITICAL'
except
KeyError
:
pass
try
:
if
value
in
self
.
get_limit
(
'nice_warning'
):
return
'WARNING'
except
KeyError
:
pass
try
:
if
value
in
self
.
get_limit
(
'nice_careful'
):
return
'CAREFUL'
except
KeyError
:
pass
return
'DEFAULT'
def
get_process_curses_data
(
self
,
p
,
first
,
args
):
"""Get curses data to display for a process.
...
...
@@ -264,11 +284,8 @@ class Plugin(GlancesPlugin):
if
nice
is
None
:
nice
=
'?'
msg
=
'{:>5}'
.
format
(
nice
)
if
isinstance
(
nice
,
int
)
and
((
WINDOWS
and
nice
!=
32
)
or
(
not
WINDOWS
and
nice
!=
0
)):
ret
.
append
(
self
.
curse_add_line
(
msg
,
decoration
=
'NICE'
))
else
:
ret
.
append
(
self
.
curse_add_line
(
msg
))
ret
.
append
(
self
.
curse_add_line
(
msg
,
decoration
=
self
.
get_nice_alert
(
nice
)))
else
:
msg
=
'{:>5}'
.
format
(
'?'
)
ret
.
append
(
self
.
curse_add_line
(
msg
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录