Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
f8e036ee
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 搜索 >>
提交
f8e036ee
编写于
6月 12, 2019
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'issue1491' into develop
上级
bdd55743
1d1a6d99
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
4 deletion
+33
-4
NEWS
NEWS
+1
-0
conf/glances.conf
conf/glances.conf
+2
-0
docs/aoa/folders.rst
docs/aoa/folders.rst
+6
-3
docs/man/glances.1
docs/man/glances.1
+1
-1
glances/folder_list.py
glances/folder_list.py
+23
-0
未找到文件。
NEWS
浏览文件 @
f8e036ee
...
...
@@ -12,6 +12,7 @@ Enhancements and new features:
* Add authprovider for cassandra export (thanks to @EmilienMottet) #1395
* Curses's browser server list sorting added (thanks to @limfreee) #1396
* ElasticSearch: add date to index, unbreak object push (thanks to @genevera) # 1438
* Performance issue with large folder #1491
Bugs corrected:
...
...
conf/glances.conf
浏览文件 @
f8e036ee
...
...
@@ -174,10 +174,12 @@ critical=90
# * careful: optional careful threshold (in MB)
# * warning: optional warning threshold (in MB)
# * critical: optional critical threshold (in MB)
# * refresh: interval in second between two refreshs
#folder_1_path=/tmp
#folder_1_careful=2500
#folder_1_warning=3000
#folder_1_critical=3500
#folder_1_refresh=60
#folder_2_path=/home/nicolargo/Videos
#folder_2_warning=17000
#folder_2_critical=20000
...
...
docs/aoa/folders.rst
浏览文件 @
f8e036ee
...
...
@@ -17,11 +17,12 @@ Each item is defined by:
- ``careful``: optional careful threshold (in MB)
- ``warning``: optional warning threshold (in MB)
- ``critical``: optional critical threshold (in MB)
- ``refresh``: interval in second between two refresh (default is 30 seconds)
Up to ``10`` items can be defined.
For example, if you want to monitor the ``/tmp`` folder
, the following
definition should do the job:
For example, if you want to monitor the ``/tmp`` folder
every minute,
the following
definition should do the job:
.. code-block:: ini
...
...
@@ -30,8 +31,10 @@ definition should do the job:
folder_1_careful=2500
folder_1_warning=3000
folder_1_critical=3500
folder_1_refresh=60
In client/server mode, the list is defined on the ``server`` side.
.. warning::
Do **NOT** define folders containing lot of files and subfolders.
Do **NOT** define folders containing lot of files and subfolders or use an
huge refresh time...
docs/man/glances.1
浏览文件 @
f8e036ee
.\" Man page generated from reStructuredText.
.
.TH "GLANCES" "1" "
Apr 18
, 2019" "3.1.1b0" "Glances"
.TH "GLANCES" "1" "
Jun 12
, 2019" "3.1.1b0" "Glances"
.SH NAME
glances \- An eye on your system
.
...
...
glances/folder_list.py
浏览文件 @
f8e036ee
...
...
@@ -22,6 +22,7 @@ from __future__ import unicode_literals
import
os
from
glances.timer
import
Timer
from
glances.compat
import
range
,
nativestr
from
glances.logger
import
logger
...
...
@@ -57,11 +58,19 @@ class FolderList(object):
__folder_list_max_size
=
10
# The folder list
__folder_list
=
[]
# Default refresh time is 30 seconds for this plugins
__default_refresh
=
30
def
__init__
(
self
,
config
):
"""Init the folder list from the configuration file, if it exists."""
self
.
config
=
config
# A list of Timer
# One timer per folder
# default timer is __default_refresh, can be overwrite by folder_1_refresh=600
self
.
timer_folders
=
[]
self
.
first_grab
=
True
if
self
.
config
is
not
None
and
self
.
config
.
has_section
(
'folders'
):
if
scandir_tag
:
# Process monitoring list
...
...
@@ -90,6 +99,12 @@ class FolderList(object):
value
[
'path'
]
=
nativestr
(
value
[
'path'
])
# Optional conf keys
# Refresh time
value
[
'refresh'
]
=
int
(
self
.
config
.
get_value
(
section
,
key
+
'refresh'
,
default
=
self
.
__default_refresh
))
self
.
timer_folders
.
append
(
Timer
(
value
[
'refresh'
]))
# Thesholds
for
i
in
[
'careful'
,
'warning'
,
'critical'
]:
# Read threshold
value
[
i
]
=
self
.
config
.
get_value
(
section
,
key
+
i
)
...
...
@@ -155,6 +170,9 @@ class FolderList(object):
# Iter upon the folder list
for
i
in
range
(
len
(
self
.
get
())):
# Update folder size
if
not
self
.
first_grab
and
not
self
.
timer_folders
[
i
].
finished
():
continue
# Get folder size
try
:
self
.
__folder_list
[
i
][
'size'
]
=
self
.
__folder_size
(
self
.
path
(
i
))
except
OSError
as
e
:
...
...
@@ -164,6 +182,11 @@ class FolderList(object):
self
.
__folder_list
[
i
][
'size'
]
=
'!'
else
:
self
.
__folder_list
[
i
][
'size'
]
=
'?'
# Reset the timer
self
.
timer_folders
[
i
].
reset
()
# It is no more the first time...
self
.
first_grab
=
False
return
self
.
__folder_list
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录