You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we using 'docker-collectd-plugin' to collect the cpu usage percentage of docker images, we noticed that we constantly get 'ZERO' cpu usage percentage. It looks like the following piece of code never been executed and we noticed that there is NO key named ': precpu_stats' existing in the 'stats' results.
if 'precpu_stats' in stats:
precpu_stats = stats['precpu_stats']
precpu_usage = precpu_stats['cpu_usage']
cpu_delta = cpu_usage['total_usage'] - precpu_usage['total_usage']
system_delta = system_cpu_usage - precpu_stats['system_cpu_usage']
if system_delta > 0 and cpu_delta > 0:
cpu_percent = 100.0 * cpu_delta / system_delta * len(percpu)
An example 'stats' results returned by running the script.
When we using 'docker-collectd-plugin' to collect the cpu usage percentage of docker images, we noticed that we constantly get 'ZERO' cpu usage percentage. It looks like the following piece of code never been executed and we noticed that there is NO key named ': precpu_stats' existing in the 'stats' results.
An example 'stats' results returned by running the script.
The text was updated successfully, but these errors were encountered: