MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / log_system_status

Method log_system_status

resource_monitor.py:223–232  ·  view source on GitHub ↗

Log current system status

(self)

Source from the content-addressed store, hash-verified

221 'throttling_occurred': False, 'raw': None,
222 'status': 'unknown', 'message': None}
223 try:
224 r = subprocess.run(['vcgencmd', 'get_throttled'],
225 capture_output=True, text=True, timeout=3)
226 if r.returncode != 0 or '=' not in (r.stdout or ''):
227 return info
228 value = int(r.stdout.strip().split('=', 1)[1], 16)
229 except (OSError, ValueError, subprocess.SubprocessError):
230 return info # not a Pi, or vcgencmd unavailable
231
232 info.update({
233 'supported': True,
234 'raw': hex(value),
235 # Live bits (condition present right now)

Callers 1

runMethod · 0.80

Calls 2

get_system_statusMethod · 0.95
infoMethod · 0.80

Tested by

no test coverage detected