Skip to content

Commit

Permalink
Disk usage info for multiple directories (#97)
Browse files Browse the repository at this point in the history
* add more info to disk usage info
  • Loading branch information
NikolaiPetukhov authored Dec 6, 2024
1 parent cdb7ab6 commit 7c34871
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions agent/worker/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,25 @@ def cpu_freq_MHZ():


def get_disk_usage():
disk_usage = psutil.disk_usage(constants.AGENT_ROOT_DIR()) # root dir mounted to host
root = psutil.disk_usage("/")
agent_data = psutil.disk_usage(constants.AGENT_ROOT_DIR()) # root dir mounted to host
apps_data = psutil.disk_usage(constants.SUPERVISELY_AGENT_FILES_CONTAINER())
res = {
"total": disk_usage.total,
"used": disk_usage.used,
"free": disk_usage.free,
"root": {
"total": root.total,
"used": root.used,
"free": root.free,
},
"agent_data": {
"total": agent_data.total,
"used": agent_data.used,
"free": agent_data.free,
},
"apps_data": {
"total": apps_data.total,
"used": apps_data.used,
"free": apps_data.free,
},
}
return res

Expand Down

0 comments on commit 7c34871

Please sign in to comment.