From 3717c2fcf97308a9b84d55a620f8fc8fed6225b4 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sat, 18 Apr 2015 16:24:54 +0200 Subject: [PATCH] Add comment for the Docker network stats issue --- glances/plugins/glances_docker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index 70b102ae..eaf056d0 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -157,6 +157,10 @@ class Plugin(GlancesPlugin): # Create a dict with all the containers' stats instance self.docker_stats = {} + # TODO: Find a way to correct this + # The following optimization is not compatible with the network stats + # The self.docker_client.stats method should be call every time in order to have network stats refreshed + # Nevertheless, if we call it every time, Glances is slow... if c['Id'] not in self.docker_stats: # Create the stats instance for the current container try: @@ -167,6 +171,7 @@ class Plugin(GlancesPlugin): # Get the docker stats try: + # self.docker_stats[c['Id']] = self.docker_client.stats(c['Id'], decode=True) all_stats = self.docker_stats[c['Id']].next() except: all_stats = {} @@ -418,7 +423,6 @@ class Plugin(GlancesPlugin): # for r in ['rx', 'tx']: # try: # value = self.auto_unit(int(container['network'][r] // container['network']['time_since_update'] * 8)) + "b" - # #value = self.auto_unit(int(container['network']['cumulative_' + r])) + 'b' # msg = '{0:>6}'.format(value) # except KeyError: # msg = '{0:>6}'.format('?')