MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_disk_details

Function get_disk_details

agentops/helpers/system.py:140–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138
139
140def get_disk_details():
141 partitions = psutil.disk_partitions()
142 disk_info = {}
143 for partition in partitions:
144 try:
145 usage = psutil.disk_usage(partition.mountpoint)
146 disk_info[partition.device] = {
147 "Mountpoint": partition.mountpoint,
148 "Total": f"{usage.total / (1024**3):.2f} GB",
149 "Used": f"{usage.used / (1024**3):.2f} GB",
150 "Free": f"{usage.free / (1024**3):.2f} GB",
151 "Percentage": f"{usage.percent}%",
152 }
153 except OSError as inaccessible:
154 # Skip inaccessible partitions, such as removable drives with no media
155 logger.debug("Mountpoint %s inaccessible: %s", partition.mountpoint, inaccessible)
156
157 return disk_info
158
159
160def get_host_env(opt_out: bool = False):

Callers 1

get_host_envFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…