mendevi.rapl.RAPL
- class mendevi.rapl.RAPL(sleep: Real = 0.05, no_fail: bool = False)[source]
Uses the linux perf command through a python context manager.
Examples
>>> import time >>> from mendevi.rapl import RAPL >>> with RAPL() as energy: ... time.sleep(1) ... >>>
Initalize the perf context.
Parameters
- sleepfloat, default=50e-3
The time interval between 2 measures (in s).
- no_failbool, default=True
If False, raise RuntimeError if it fails to get the RAPL measure. Otherwise (if True), return None instead of failing.