Skip to content

Commit

Permalink
Code should be refactor in order to make it more easy to update if a …
Browse files Browse the repository at this point in the history
…new container engine is added
  • Loading branch information
nicolargo committed Jan 22, 2023
1 parent 5dd133a commit b43bf2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glances/plugins/glances_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,12 @@ def update_podman(self):
# Standards stats
if container_stats['Status'] in ('running', 'paused'):
# CPU
# '3.21%' to 3.21
# Convert: '3.21%' to 3.21
container_stats['cpu_percent'] = float(podman_stats[container_stats['IdShort']]['CPU'][:-1])
container_stats['cpu'] = {'total': container_stats['cpu_percent']}
# MEMORY
# @TODO
# Should convert 'MemUsage': '352.3kB / 7.836GB' to bytes...
# Convert 'MemUsage': '352.3kB / 7.836GB' to bytes
# Yes it is ungly but the API do not expose the memory limit in bytes...
container_stats['memory'] = {
'usage': string_value_to_float(podman_stats[container_stats['IdShort']]['MemUsage'].split(' / ')[0]),
'limit': string_value_to_float(podman_stats[container_stats['IdShort']]['MemUsage'].split(' / ')[1]),
Expand Down

0 comments on commit b43bf2b

Please sign in to comment.