Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
412b8afc
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,发现更多精彩内容 >>
提交
412b8afc
编写于
10月 25, 2014
作者:
N
Nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Correct issue #433 on battery percent update
上级
4abad6e8
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
34 addition
and
10 deletion
+34
-10
glances/plugins/glances_batpercent.py
glances/plugins/glances_batpercent.py
+3
-1
glances/plugins/glances_cpu.py
glances/plugins/glances_cpu.py
+1
-0
glances/plugins/glances_diskio.py
glances/plugins/glances_diskio.py
+1
-0
glances/plugins/glances_fs.py
glances/plugins/glances_fs.py
+1
-0
glances/plugins/glances_load.py
glances/plugins/glances_load.py
+4
-2
glances/plugins/glances_mem.py
glances/plugins/glances_mem.py
+1
-0
glances/plugins/glances_memswap.py
glances/plugins/glances_memswap.py
+1
-0
glances/plugins/glances_network.py
glances/plugins/glances_network.py
+1
-0
glances/plugins/glances_plugin.py
glances/plugins/glances_plugin.py
+12
-0
glances/plugins/glances_sensors.py
glances/plugins/glances_sensors.py
+9
-7
未找到文件。
glances/plugins/glances_batpercent.py
浏览文件 @
412b8afc
...
...
@@ -84,12 +84,14 @@ class GlancesGrabBat(object):
self
.
initok
=
True
self
.
bat_list
=
[]
self
.
update
()
except
Exception
:
except
Exception
as
e
:
self
.
initok
=
False
logger
.
debug
(
"Can not init GlancesGrabBat class (%s)"
%
e
)
def
update
(
self
):
"""Update the stats."""
if
self
.
initok
:
self
.
bat
.
update
()
self
.
bat_list
=
[{
'label'
:
_
(
"Battery (%)"
),
'value'
:
self
.
getcapacitypercent
()}]
else
:
self
.
bat_list
=
[]
...
...
glances/plugins/glances_cpu.py
浏览文件 @
412b8afc
...
...
@@ -64,6 +64,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
{}
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update CPU stats using the input method."""
# Reset stats
...
...
glances/plugins/glances_diskio.py
浏览文件 @
412b8afc
...
...
@@ -53,6 +53,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
[]
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update disk I/O stats using the input method."""
# Reset stats
...
...
glances/plugins/glances_fs.py
浏览文件 @
412b8afc
...
...
@@ -77,6 +77,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
[]
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update the FS stats using the input method."""
# Reset the list
...
...
glances/plugins/glances_load.py
浏览文件 @
412b8afc
...
...
@@ -38,7 +38,7 @@ snmp_oid = {'min1': '1.3.6.1.4.1.2021.10.1.3.1',
# Define the history items list
# All items in this list will be historised if the --enable-history tag is set
# 'color' define the graph color in #RGB format
items_history_list
=
[{
'name'
:
'min1'
,
'color'
:
'#0000FF'
},
items_history_list
=
[{
'name'
:
'min1'
,
'color'
:
'#0000FF'
},
{
'name'
:
'min5'
,
'color'
:
'#0000AA'
},
{
'name'
:
'min15'
,
'color'
:
'#000044'
}]
...
...
@@ -52,7 +52,8 @@ class Plugin(GlancesPlugin):
def
__init__
(
self
,
args
=
None
):
"""Init the plugin."""
GlancesPlugin
.
__init__
(
self
,
args
=
args
,
items_history_list
=
items_history_list
)
GlancesPlugin
.
__init__
(
self
,
args
=
args
,
items_history_list
=
items_history_list
)
# We want to display the stat in the curse interface
self
.
display_curse
=
True
...
...
@@ -70,6 +71,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
{}
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update load stats."""
# Reset stats
...
...
glances/plugins/glances_mem.py
浏览文件 @
412b8afc
...
...
@@ -72,6 +72,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
{}
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update RAM memory stats using the input method."""
# Reset stats
...
...
glances/plugins/glances_memswap.py
浏览文件 @
412b8afc
...
...
@@ -61,6 +61,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
{}
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update swap memory stats using the input method."""
# Reset stats
...
...
glances/plugins/glances_network.py
浏览文件 @
412b8afc
...
...
@@ -61,6 +61,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
[]
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update network stats using the input method.
...
...
glances/plugins/glances_plugin.py
浏览文件 @
412b8afc
...
...
@@ -494,3 +494,15 @@ class GlancesPlugin(object):
return
'{0:.{decimal}f}{symbol}'
.
format
(
value
,
decimal
=
decimal_precision
,
symbol
=
symbol
)
return
'{0!s}'
.
format
(
number
)
def
_log_result_decorator
(
fct
):
"""Log (DEBUG) the result of the function fct"""
def
wrapper
(
*
args
,
**
kw
):
ret
=
fct
(
*
args
,
**
kw
)
logger
.
debug
(
"%s %s %s return %s"
%
(
args
[
0
].
__class__
.
__name__
,
args
[
0
].
__class__
.
__module__
[
len
(
'glances_'
):],
fct
.
func_name
,
ret
))
return
ret
return
wrapper
# Mandatory to call the decorator in childs' classes
_log_result_decorator
=
staticmethod
(
_log_result_decorator
)
glances/plugins/glances_sensors.py
浏览文件 @
412b8afc
...
...
@@ -27,7 +27,7 @@ except ImportError:
pass
# Import Glances lib
from
glances.core.glances_globals
import
is_py3
from
glances.core.glances_globals
import
is_py3
,
logger
from
glances.plugins.glances_batpercent
import
Plugin
as
BatPercentPlugin
from
glances.plugins.glances_hddtemp
import
Plugin
as
HddTempPlugin
from
glances.plugins.glances_plugin
import
GlancesPlugin
...
...
@@ -67,6 +67,7 @@ class Plugin(GlancesPlugin):
"""Reset/init the stats."""
self
.
stats
=
[]
@
GlancesPlugin
.
_log_result_decorator
def
update
(
self
):
"""Update sensors stats using the input method."""
# Reset the stats
...
...
@@ -77,14 +78,14 @@ class Plugin(GlancesPlugin):
try
:
self
.
stats
=
self
.
__set_type
(
self
.
glancesgrabsensors
.
get
(),
'temperature_core'
)
except
:
pass
except
Exception
as
e
:
logger
.
error
(
"Can not grab sensors temperatures (%s)"
%
e
)
# Update HDDtemp stats
try
:
hddtemp
=
self
.
__set_type
(
self
.
hddtemp_plugin
.
update
(),
'temperature_hdd'
)
except
:
pass
except
Exception
as
e
:
logger
.
error
(
"Can not grab HDD temperature (%s)"
%
e
)
else
:
# Append HDD temperature
self
.
stats
.
extend
(
hddtemp
)
...
...
@@ -92,11 +93,12 @@ class Plugin(GlancesPlugin):
try
:
batpercent
=
self
.
__set_type
(
self
.
batpercent_plugin
.
update
(),
'battery'
)
except
:
pass
except
Exception
as
e
:
logger
.
error
(
"Can not grab battery percent (%s)"
%
e
)
else
:
# Append Batteries %
self
.
stats
.
extend
(
batpercent
)
elif
self
.
get_input
()
==
'snmp'
:
# Update stats using SNMP
# No standard:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录