Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
91efbc6a
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,发现更多精彩内容 >>
提交
91efbc6a
编写于
12月 04, 2011
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add control before division
上级
85fd725d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
49 addition
and
36 deletion
+49
-36
NEWS
NEWS
+4
-0
TODO
TODO
+1
-0
autom4te.cache/output.0
autom4te.cache/output.0
+10
-10
autom4te.cache/output.1
autom4te.cache/output.1
+10
-10
autom4te.cache/traces.1
autom4te.cache/traces.1
+1
-1
configure
configure
+10
-10
src/glances.py
src/glances.py
+13
-5
未找到文件。
NEWS
浏览文件 @
91efbc6a
Version 1.1
===========
* Check if mem.total = 0 before division (Bug #1)
TODO
0 → 100644
浏览文件 @
91efbc6a
- Add color indicators in the last line (right)
autom4te.cache/output.0
浏览文件 @
91efbc6a
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.68 for Glances
0.1
.
@%:@ Generated by GNU Autoconf 2.68 for Glances
1.0
.
@%:@
@%:@
@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
...
...
@@ -556,8 +556,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Glances'
PACKAGE_TARNAME='glances'
PACKAGE_VERSION='
0.1
'
PACKAGE_STRING='Glances
0.1
'
PACKAGE_VERSION='
1.0
'
PACKAGE_STRING='Glances
1.0
'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
...
...
@@ -1185,7 +1185,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Glances
0.1
to adapt to many kinds of systems.
\`configure' configures Glances
1.0
to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
...
...
@@ -1251,7 +1251,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Glances
0.1
:";;
short | recursive ) echo "Configuration of Glances
1.0
:";;
esac
cat <<\_ACEOF
...
...
@@ -1325,7 +1325,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Glances configure
0.1
Glances configure
1.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
...
...
@@ -1342,7 +1342,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Glances $as_me
0.1
, which was
It was created by Glances $as_me
1.0
, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
...
...
@@ -2163,7 +2163,7 @@ fi
# Define the identity of the package.
PACKAGE='glances'
VERSION='
0.1
'
VERSION='
1.0
'
cat >>confdefs.h <<_ACEOF
...
...
@@ -2970,7 +2970,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Glances $as_me
0.1
, which was
This file was extended by Glances $as_me
1.0
, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
...
...
@@ -3032,7 +3032,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Glances config.status
0.1
Glances config.status
1.0
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
...
...
autom4te.cache/output.1
浏览文件 @
91efbc6a
@%:@! /bin/sh
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.68 for Glances
0.1
.
@%:@ Generated by GNU Autoconf 2.68 for Glances
1.0
.
@%:@
@%:@
@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
...
...
@@ -556,8 +556,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Glances'
PACKAGE_TARNAME='glances'
PACKAGE_VERSION='
0.1
'
PACKAGE_STRING='Glances
0.1
'
PACKAGE_VERSION='
1.0
'
PACKAGE_STRING='Glances
1.0
'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
...
...
@@ -1185,7 +1185,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Glances
0.1
to adapt to many kinds of systems.
\`configure' configures Glances
1.0
to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
...
...
@@ -1251,7 +1251,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Glances
0.1
:";;
short | recursive ) echo "Configuration of Glances
1.0
:";;
esac
cat <<\_ACEOF
...
...
@@ -1325,7 +1325,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Glances configure
0.1
Glances configure
1.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
...
...
@@ -1342,7 +1342,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Glances $as_me
0.1
, which was
It was created by Glances $as_me
1.0
, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
...
...
@@ -2163,7 +2163,7 @@ fi
# Define the identity of the package.
PACKAGE='glances'
VERSION='
0.1
'
VERSION='
1.0
'
cat >>confdefs.h <<_ACEOF
...
...
@@ -2970,7 +2970,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Glances $as_me
0.1
, which was
This file was extended by Glances $as_me
1.0
, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
...
...
@@ -3032,7 +3032,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Glances config.status
0.1
Glances config.status
1.0
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
...
...
autom4te.cache/traces.1
浏览文件 @
91efbc6a
m4trace:configure.ac:4: -1- AC_INIT([Glances], [
0.1
], [], [glances])
m4trace:configure.ac:4: -1- AC_INIT([Glances], [
1.0
], [], [glances])
m4trace:configure.ac:4: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:4: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:4: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
...
...
configure
浏览文件 @
91efbc6a
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for Glances
0.1
.
# Generated by GNU Autoconf 2.68 for Glances
1.0
.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
...
...
@@ -556,8 +556,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME
=
'Glances'
PACKAGE_TARNAME
=
'glances'
PACKAGE_VERSION
=
'
0.1
'
PACKAGE_STRING
=
'Glances
0.1
'
PACKAGE_VERSION
=
'
1.0
'
PACKAGE_STRING
=
'Glances
1.0
'
PACKAGE_BUGREPORT
=
''
PACKAGE_URL
=
''
...
...
@@ -1185,7 +1185,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat
<<
_ACEOF
\`
configure' configures Glances
0.1
to adapt to many kinds of systems.
\`
configure' configures Glances
1.0
to adapt to many kinds of systems.
Usage:
$0
[OPTION]... [VAR=VALUE]...
...
...
@@ -1251,7 +1251,7 @@ fi
if
test
-n
"
$ac_init_help
"
;
then
case
$ac_init_help
in
short
|
recursive
)
echo
"Configuration of Glances
0.1
:"
;;
short
|
recursive
)
echo
"Configuration of Glances
1.0
:"
;;
esac
cat
<<
\
_ACEOF
...
...
@@ -1325,7 +1325,7 @@ fi
test
-n
"
$ac_init_help
"
&&
exit
$ac_status
if
$ac_init_version
;
then
cat
<<
\
_ACEOF
Glances configure
0.1
Glances configure
1.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
...
...
@@ -1342,7 +1342,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Glances
$as_me
0.1
, which was
It was created by Glances
$as_me
1.0
, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0
$@
...
...
@@ -2163,7 +2163,7 @@ fi
# Define the identity of the package.
PACKAGE
=
'glances'
VERSION
=
'
0.1
'
VERSION
=
'
1.0
'
cat
>>
confdefs.h
<<
_ACEOF
...
...
@@ -2970,7 +2970,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Glances
$as_me
0.1
, which was
This file was extended by Glances
$as_me
1.0
, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES =
$CONFIG_FILES
...
...
@@ -3032,7 +3032,7 @@ _ACEOF
cat
>>
$CONFIG_STATUS
<<
_ACEOF
|| ac_write_fail=1
ac_cs_config="`
$as_echo
"
$ac_configure_args
" | sed 's/^ //; s/[
\\
""
\`\$
]/
\\\\
&/g'`"
ac_cs_version="
\\
Glances config.status
0.1
Glances config.status
1.0
configured by
$0
, generated by GNU Autoconf 2.68,
with options
\\
"
\$
ac_cs_config
\\
"
...
...
src/glances.py
浏览文件 @
91efbc6a
...
...
@@ -33,7 +33,7 @@ import statgrab
#==================
# The glances version id
__version__
=
"1.
0
"
__version__
=
"1.
1
"
# Class
#======
...
...
@@ -124,10 +124,10 @@ class glancesStats():
if
sortedby
==
'auto'
:
# If global Mem > 70% sort by process size
# Else sort by cpu comsoption
if
(
(
(
self
.
mem
[
'used'
]
-
self
.
mem
[
'cache'
])
*
100
/
self
.
mem
[
'total'
])
>
70
):
sortedby
=
'proc_size'
else
:
sortedby
=
'cpu_percent
'
sortedby
=
'cpu_percent'
if
(
self
.
mem
[
'total'
]
!=
0
):
if
(
(
(
self
.
mem
[
'used'
]
-
self
.
mem
[
'cache'
])
*
100
/
self
.
mem
[
'total'
])
>
70
):
sortedby
=
'proc_size
'
return
sorted
(
self
.
process
,
key
=
lambda
process
:
process
[
sortedby
],
reverse
=
True
)
...
...
@@ -183,6 +183,7 @@ class glancesScreen():
# Text colors/styles
self
.
title_color
=
curses
.
A_BOLD
|
curses
.
A_UNDERLINE
self
.
no_color
=
curses
.
color_pair
(
1
)
self
.
default_color
=
curses
.
color_pair
(
3
)
|
curses
.
A_BOLD
self
.
if50pc_color
=
curses
.
color_pair
(
4
)
|
curses
.
A_BOLD
self
.
if70pc_color
=
curses
.
color_pair
(
5
)
|
curses
.
A_BOLD
...
...
@@ -212,7 +213,14 @@ class glancesScreen():
# If current > 70% of max then color = self.if70pc_color / A_BOLD
# If current > 90% of max then color = self.if90pc_color / A_REVERSE
# By default: color = self.default_color / 0
max
=
0
try
:
(
current
*
100
)
/
max
except
ZeroDivisionError
:
return
self
.
no_color
variable
=
(
current
*
100
)
/
max
if
variable
>
90
:
if
self
.
hascolors
:
return
self
.
if90pc_color
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录