Registry / observability / mozsystemmonitor

mozsystemmonitor

JSON →
library1.0.1pypypi✓ verified 80d ago

A library to monitor system resource usage such as CPU, memory, and disk I/O. Current version is 1.0.1, with minimal recent updates.

pip install mozsystemmonitor
INSTALL
IMPORT
SIG · MOZSYSTEMMONITOR
M
mozsystemmonitor
observabilitypythonv1.0.1
Install
1.7s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SystemMonitor
import mozsystemmonitor
from mozsystemmonitor import SystemMonitor

Start the monitor, wait 5 seconds, stop, and print the last CPU measurement.

from mozsystemmonitor import SystemMonitor import time monitor = SystemMonitor(1.0) # sample interval in seconds monitor.start() time.sleep(5) monitor.stop() measurements = monitor.measurements print(f"CPU average: {measurements.cpu_percent[-1] if measurements.cpu_percent else 'N/A'}")
Debug
Known issues
gotchaThe monitor uses a high-resolution timer but may not work correctly on virtualized environments or containers where /proc/stat is limited.
fix
Ensure full /proc filesystem access (Linux) or test on actual hardware.
affects: all
deprecatedThe 'start' method returns None; it does not return a future or handle. For async use, wrap in a thread.
fix
Use threading explicitly if non-blocking behavior is required.
affects: all
gotchaDisk I/O measurements may not be available on all platforms (Windows requires administrator privileges).
fix
Check availability via 'monitor.available_metrics' before accessing disk data.
affects: all
Upgrade
Version history
1.0.1latest on PyPI · released Nov 14, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
2
Resources
mozsystemmonitor — pip install mozsystemmonitor · libregistry