Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
ad62f25a
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 搜索 >>
提交
ad62f25a
编写于
10月 31, 2016
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'refactorplugins' into develop
上级
30c5890a
fb7646d5
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
19 addition
and
66 deletion
+19
-66
glances/plugins/glances_cpu.py
glances/plugins/glances_cpu.py
+0
-6
glances/plugins/glances_diskio.py
glances/plugins/glances_diskio.py
+0
-6
glances/plugins/glances_docker.py
glances/plugins/glances_docker.py
+0
-3
glances/plugins/glances_fs.py
glances/plugins/glances_fs.py
+0
-6
glances/plugins/glances_ip.py
glances/plugins/glances_ip.py
+0
-3
glances/plugins/glances_irq.py
glances/plugins/glances_irq.py
+1
-3
glances/plugins/glances_load.py
glances/plugins/glances_load.py
+0
-6
glances/plugins/glances_mem.py
glances/plugins/glances_mem.py
+0
-6
glances/plugins/glances_memswap.py
glances/plugins/glances_memswap.py
+0
-6
glances/plugins/glances_network.py
glances/plugins/glances_network.py
+0
-6
glances/plugins/glances_plugin.py
glances/plugins/glances_plugin.py
+7
-1
glances/plugins/glances_quicklook.py
glances/plugins/glances_quicklook.py
+0
-3
glances/plugins/glances_raid.py
glances/plugins/glances_raid.py
+0
-3
glances/plugins/glances_sensors.py
glances/plugins/glances_sensors.py
+0
-3
glances/plugins/glances_wifi.py
glances/plugins/glances_wifi.py
+0
-3
glances/stats.py
glances/stats.py
+5
-1
glances/stats_client_snmp.py
glances/stats_client_snmp.py
+6
-1
未找到文件。
glances/plugins/glances_cpu.py
浏览文件 @
ad62f25a
...
...
@@ -98,12 +98,6 @@ class Plugin(GlancesPlugin):
elif
self
.
input_method
==
'snmp'
:
self
.
update_snmp
()
# Update the history list
self
.
update_stats_history
()
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_local
(
self
):
...
...
glances/plugins/glances_diskio.py
浏览文件 @
ad62f25a
...
...
@@ -142,12 +142,6 @@ class Plugin(GlancesPlugin):
# No standard way for the moment...
pass
# Update the history list
self
.
update_stats_history
(
'disk_name'
)
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_docker.py
浏览文件 @
ad62f25a
...
...
@@ -237,9 +237,6 @@ class Plugin(GlancesPlugin):
# Not available
pass
# Update the view
self
.
update_views
()
return
self
.
stats
def
get_docker_cpu
(
self
,
container_id
,
all_stats
):
...
...
glances/plugins/glances_fs.py
浏览文件 @
ad62f25a
...
...
@@ -180,12 +180,6 @@ class Plugin(GlancesPlugin):
'key'
:
self
.
get_key
()}
self
.
stats
.
append
(
fs_current
)
# Update the history list
self
.
update_stats_history
(
'mnt_point'
)
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_ip.py
浏览文件 @
ad62f25a
...
...
@@ -105,9 +105,6 @@ class Plugin(GlancesPlugin):
# Not implemented yet
pass
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_irq.py
浏览文件 @
ad62f25a
...
...
@@ -96,11 +96,9 @@ class Plugin(GlancesPlugin):
# not available
pass
# Update the view
self
.
update_views
()
self
.
stats
=
sorted
(
self
.
stats
,
key
=
operator
.
itemgetter
(
'irq_rate'
),
reverse
=
True
)[:
5
]
# top 5 IRQ by rate/s
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_load.py
浏览文件 @
ad62f25a
...
...
@@ -109,12 +109,6 @@ class Plugin(GlancesPlugin):
self
.
stats
[
'cpucore'
]
=
self
.
nb_log_core
# Update the history list
self
.
update_stats_history
()
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_mem.py
浏览文件 @
ad62f25a
...
...
@@ -157,12 +157,6 @@ class Plugin(GlancesPlugin):
# percent: the percentage usage calculated as (total - available) / total * 100.
self
.
stats
[
'percent'
]
=
float
((
self
.
stats
[
'total'
]
-
self
.
stats
[
'free'
])
/
self
.
stats
[
'total'
]
*
100
)
# Update the history list
self
.
update_stats_history
()
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_memswap.py
浏览文件 @
ad62f25a
...
...
@@ -132,12 +132,6 @@ class Plugin(GlancesPlugin):
self
.
stats
[
'percent'
]
=
float
(
(
self
.
stats
[
'total'
]
-
self
.
stats
[
'free'
])
/
self
.
stats
[
'total'
]
*
100
)
# Update the history list
self
.
update_stats_history
()
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_network.py
浏览文件 @
ad62f25a
...
...
@@ -224,12 +224,6 @@ class Plugin(GlancesPlugin):
# Save stats to compute next bitrate
self
.
network_old
=
network_new
# Update the history list
self
.
update_stats_history
(
self
.
get_key
())
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_plugin.py
浏览文件 @
ad62f25a
...
...
@@ -124,8 +124,14 @@ class GlancesPlugin(object):
logger
.
debug
(
"Reset history for plugin {0} (items: {1})"
.
format
(
self
.
plugin_name
,
reset_list
))
self
.
stats_history
.
reset
()
def
update_stats_history
(
self
,
item_name
=
''
):
def
update_stats_history
(
self
):
"""Update stats history."""
# If the plugin data is a dict, the dict's key should be used
if
self
.
get_key
()
is
None
:
item_name
=
''
else
:
item_name
=
self
.
get_key
()
# Build the history
if
self
.
stats
and
self
.
_history_enable
():
for
i
in
self
.
get_items_history_list
():
if
isinstance
(
self
.
stats
,
list
):
...
...
glances/plugins/glances_quicklook.py
浏览文件 @
ad62f25a
...
...
@@ -86,9 +86,6 @@ class Plugin(GlancesPlugin):
self
.
stats
[
'cpu_hz_current'
]
=
cpu_info
[
'hz_actual_raw'
][
0
]
self
.
stats
[
'cpu_hz'
]
=
cpu_info
[
'hz_advertised_raw'
][
0
]
# Update the view
self
.
update_views
()
return
self
.
stats
def
update_views
(
self
):
...
...
glances/plugins/glances_raid.py
浏览文件 @
ad62f25a
...
...
@@ -72,9 +72,6 @@ class Plugin(GlancesPlugin):
# No standard way for the moment...
pass
# Update the view
self
.
update_views
()
return
self
.
stats
def
msg_curse
(
self
,
args
=
None
):
...
...
glances/plugins/glances_sensors.py
浏览文件 @
ad62f25a
...
...
@@ -132,9 +132,6 @@ class Plugin(GlancesPlugin):
pass
# Update the view
self
.
update_views
()
return
self
.
stats
def
__set_type
(
self
,
stats
,
sensor_type
):
...
...
glances/plugins/glances_wifi.py
浏览文件 @
ad62f25a
...
...
@@ -124,9 +124,6 @@ class Plugin(GlancesPlugin):
# Not implemented yet
pass
# Update the view
self
.
update_views
()
return
self
.
stats
def
get_alert
(
self
,
value
):
...
...
glances/stats.py
浏览文件 @
ad62f25a
...
...
@@ -154,8 +154,12 @@ class GlancesStats(object):
# If current plugin is disable
# then continue to next plugin
continue
# Update the stats
# Update the stats
...
self
.
_plugins
[
p
].
update
()
# ... the history
self
.
_plugins
[
p
].
update_stats_history
()
# ... and the views
self
.
_plugins
[
p
].
update_views
()
def
export
(
self
,
input_stats
=
None
):
"""Export all the stats.
...
...
glances/stats_client_snmp.py
浏览文件 @
ad62f25a
...
...
@@ -109,8 +109,13 @@ class GlancesStatsClientSNMP(GlancesStats):
self
.
_plugins
[
p
].
input_method
=
'snmp'
self
.
_plugins
[
p
].
short_system_name
=
self
.
system_name
# Update the stats
# Update the stats
...
try
:
self
.
_plugins
[
p
].
update
()
except
Exception
as
e
:
logger
.
error
(
"Update {} failed: {}"
.
format
(
p
,
e
))
else
:
# ... the history
self
.
_plugins
[
p
].
update_stats_history
()
# ... and the views
self
.
_plugins
[
p
].
update_views
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录