Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
e8730ec5
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 搜索 >>
提交
e8730ec5
编写于
3月 09, 2014
作者:
N
Nicolas Hennion
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimise sort for log
上级
473eb62b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
20 deletion
+14
-20
glances/__init__.py
glances/__init__.py
+3
-2
glances/core/glances_logs.py
glances/core/glances_logs.py
+8
-10
glances/core/glances_main.py
glances/core/glances_main.py
+2
-3
glances/core/glances_processes.py
glances/core/glances_processes.py
+0
-4
glances/core/glances_server.py
glances/core/glances_server.py
+1
-1
未找到文件。
glances/__init__.py
浏览文件 @
e8730ec5
...
...
@@ -42,7 +42,8 @@ def main(argv=None):
elif
(
core
.
is_client
()):
# !!!
print
"Client mode"
print
(
_
(
"Glances client connected to %s:%s"
)
%
(
core
.
server_ip
,
core
.
server_port
))
print
(
"TODO..."
)
elif
(
core
.
is_server
()):
# Import the Glances server module
from
.core.glances_server
import
GlancesServer
...
...
@@ -51,7 +52,7 @@ def main(argv=None):
server
=
GlancesServer
(
bind_address
=
core
.
bind_ip
,
bind_port
=
int
(
core
.
server_port
),
cached_time
=
core
.
cached_time
,
config
=
core
.
config
)
config
=
core
.
get_config
()
)
# print(_("Glances server is running on %s:%s with config file %s") % (core.bind_ip, core.server_port, core.config.get_config_path()))
print
(
_
(
"Glances server is running on %s:%s"
)
%
(
core
.
bind_ip
,
core
.
server_port
))
...
...
glances/core/glances_logs.py
浏览文件 @
e8730ec5
...
...
@@ -108,16 +108,6 @@ class glancesLogs:
# Do no sort process for monitored prcesses list
self
.
sort_process_by
=
'none'
# Sort processes
if
(
process_auto_by
!=
'none'
):
# !!! Process list is sorted twise ???
# !!! Here and in the processlist plugin
topprocess
=
sorted
(
proc_list
,
key
=
lambda
process
:
process
[
process_auto_by
],
reverse
=
True
)
else
:
# !!! Never in v2 because MON are not logged...
topprocess
=
proc_list
# Add or update the log
item_index
=
self
.
__itemexist__
(
item_type
)
if
(
item_index
<
0
):
...
...
@@ -136,6 +126,10 @@ class glancesLogs:
item
.
append
(
item_value
)
# MIN
item
.
append
(
item_value
)
# SUM
item
.
append
(
1
)
# COUNT
# Process list is sorted automaticaly
# Overwrite the user choise
topprocess
=
sorted
(
proc_list
,
key
=
lambda
process
:
process
[
process_auto_by
],
reverse
=
True
)
item
.
append
(
topprocess
[
0
:
3
])
# TOP 3 PROCESS LIST
item
.
append
(
proc_desc
)
# MONITORED PROCESSES DESC
self
.
logs_list
.
insert
(
0
,
item
)
...
...
@@ -166,6 +160,10 @@ class glancesLogs:
self
.
logs_list
[
item_index
][
8
]
+=
1
self
.
logs_list
[
item_index
][
5
]
=
(
self
.
logs_list
[
item_index
][
7
]
/
self
.
logs_list
[
item_index
][
8
])
# Process list is sorted automaticaly
# Overwrite the user choise
topprocess
=
sorted
(
proc_list
,
key
=
lambda
process
:
process
[
process_auto_by
],
reverse
=
True
)
# TOP PROCESS LIST
self
.
logs_list
[
item_index
][
9
]
=
topprocess
[
0
:
3
]
# MONITORED PROCESSES DESC
...
...
glances/core/glances_main.py
浏览文件 @
e8730ec5
...
...
@@ -102,11 +102,10 @@ class GlancesMain(object):
if
(
self
.
is_standalone
()):
# Stop the classical CLI loop
# !!! Uncomment
# screen.end()
pass
screen
.
end
()
elif
(
self
.
is_client
()):
# Stop the client loop
# !!! Uncomment
#~ client.client_quit()
pass
elif
(
self
.
is_server
()):
...
...
glances/core/glances_processes.py
浏览文件 @
e8730ec5
...
...
@@ -195,10 +195,6 @@ class glancesProcesses:
"""
Return the processlist
"""
# if (sorted_by is not None):
# # Need to sort ?
# self.processlist = sorted(self.processlist, key=lambda process: process[sorted_by], reverse=True)
# return self.processlist
if
(
sortedby
is
None
):
# No need to sort...
...
...
glances/core/glances_server.py
浏览文件 @
e8730ec5
...
...
@@ -199,7 +199,7 @@ class GlancesInstance():
# Default behavior
raise
AttributeError
(
item
)
#!!! How to implement theses method in v2 ?
#
!!! How to implement theses method in v2 ?
# def __getTimeSinceLastUpdate(self, IOType):
# assert(IOType in ['net', 'disk', 'process_disk'])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录