mendevi.measures

All measurement helper.

Classes

Activity([sleep])

Measure the computer activity of a section.

Details

class mendevi.measures.Activity(sleep: Real = 0.05)[source]

Measure the computer activity of a section.

Examples

>>> import pprint, time
>>> from mendevi.measures import Activity
>>> with Activity() as activity:
...     time.sleep(0.1)
...     activity.start_slice("lbl 1")
...     time.sleep(0.2)
...     _ = activity.stop_slice()
...     activity.start_slice("lbl 2")
...     time.sleep(0.3)
...     activity.start_slice("lbl 3")
...     time.sleep(0.4)
...
>>> slices, full = activity.get_slices(), activity.get_full()
>>> round(full["duration"], 2)
1.0
>>> sorted(slices)
['lbl 1', 'lbl 2', 'lbl 3']
>>> round(slices["lbl 2"]["duration"], 2)
0.3
>>>

Init the perf context.

Parameters

sleepfloat, default=50e-3

The time interval between 2 measures (in s).

Modules

adecwatts

Get the power consumption of as usb plugded ADEC WATTS wattmeters.

context

Get the information of the environment.

g5kpower(hostname, start, duration, *[, ...])

Do a request to get the grid5000 consumption.

gpu

Query the GPUs activity.

psutil

Use psutil to record the CPU and RAM usage.

rapl

Try to read the energy with RAPL.