Energy Probe

class pyutils.proc.bench.EnergyProbe

Abstract class representing an object that can be polled in order to retrieve power samples for a specific task.

start(task)

Called by the energy profiler once it starts acquiring samples. This is the preferred place to reset the probe’s internal state and to initialize any needed resources.

Parameters

task (Task) – Profiled task.

Return type

None

poll()

Called periodically by the energy profiler. The probe must compute and store a single sample, which should be proportional to the average power usage in the period between the current and the previous call to this method.

Return type

None

stop()

Called by the energy profiler at the end of the task. The probe should stop acquiring samples, and it must return a list of all the samples it acquired since start() was called.

Return type

List[float]

Returns

List of acquired samples.