mendevi.g5kpower.g5kpower
- mendevi.g5kpower.g5kpower(hostname: str, start: Real, duration: Real, *, login: str | None = None, password: str | None = None) dict[str][source]
Do a request to get the grid5000 consumption.
Parameters
- hostnamestr
The hostname containing the node name and the site. It can be get with platform.node().
- startfloat
The starting timestamp, it can be get by time.time().
- durationfloat
The job duration in seconds.
- login, pswstr
Username an password for grid5000 api.
Returns
- Consumption: dict[str]
‘dt’: The time difference between 2 consecutive power measurements (in s).
‘energy’: The total energy consumption (in J).
‘power’: The average power, energy divided by the duration (in w).
‘powers’: The power measured between 2 consecutive points (in w).
Raises
- ValueError
If the request failed.
Examples
>>> import platform, time >>> from mendevi.g5kpower import g5kpower >>> g5kpower(platform.node(), time.time()-10.0, 10.0) >>>
Notes
Tested with oarsub -I -p paradoxe -t deploy -t monitor=’wattmetre_power_watt’.
Power and time measurements are differental to increase the compressibility of the database containing this result.
Energy is estimated from the trapezoidal integral of instantaneous powers.