Merge branch 'develop' of github.com:nicolargo/glances into develop

This commit is contained in:
Nicolargo 2015-01-30 19:27:18 +01:00
commit 928026c8c1
4 changed files with 29 additions and 14 deletions

View File

@ -20,7 +20,7 @@
"""Init the Glances software."""
__appname__ = 'glances'
__version__ = '2.3_RC1'
__version__ = '2.3_RC2'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPL'

View File

@ -84,11 +84,18 @@ body {
padding-left: 20px;
}
#processlist table tr td {
text-align: right;
}
#processlist table tr td,
#docker table tr td {
padding: 0px 5px 0px 5px;
white-space: nowrap;
text-align: right;
}
#processlist table tr td:nth-child(6),
#processlist table tr td:nth-child(12) {
text-align: left;
}
#docker table tr td:nth-child(2),
#docker table tr td:nth-child(6) {
text-align: left;
}

View File

@ -168,13 +168,17 @@ class Plugin(GlancesPlugin):
Output: a dict {'total': 1.49, 'user': 0.65, 'system': 0.84}"""
ret = {}
# Read the stats
with open('/sys/fs/cgroup/cpuacct/docker/' + id + '/cpuacct.stat', 'r') as f:
for line in f:
m = re.search(r"(system|user)\s+(\d+)", line)
if m:
ret[m.group(1)] = int(m.group(2))
try:
with open('/sys/fs/cgroup/cpuacct/docker/' + id + '/cpuacct.stat', 'r') as f:
for line in f:
m = re.search(r"(system|user)\s+(\d+)", line)
if m:
ret[m.group(1)] = int(m.group(2))
except IOError as e:
logger.error("Can not grab container CPU stat ({0})".format(e))
return ret
# Get the user ticks
ticks = self.get_user_ticks()
ticks = self.get_user_ticks()
if isinstance(ret["system"], numbers.Number) and isinstance(ret["user"], numbers.Number):
ret["total"] = ret["system"] + ret["user"]
for k in ret.keys():
@ -188,11 +192,15 @@ class Plugin(GlancesPlugin):
Output: a dict {'rss': 1015808, 'cache': 356352}"""
ret = {}
# Read the stats
with open('/sys/fs/cgroup/memory/docker/' + id + '/memory.stat', 'r') as f:
for line in f:
m = re.search(r"(rss|cache)\s+(\d+)", line)
if m:
ret[m.group(1)] = int(m.group(2))
try:
with open('/sys/fs/cgroup/memory/docker/' + id + '/memory.stat', 'r') as f:
for line in f:
m = re.search(r"(rss|cache)\s+(\d+)", line)
if m:
ret[m.group(1)] = int(m.group(2))
except IOError as e:
logger.error("Can not grab container MEM stat ({0})".format(e))
return ret
# Return the stats
return ret

View File

@ -52,7 +52,7 @@ def get_requires():
setup(
name='Glances',
version='2.3RC1',
version='2.3RC2',
description="A cross-platform curses-based monitoring tool",
long_description=open('README.rst').read(),
author='Nicolas Hennion',