mendevi.database.complete

Fill the SQL database.

Functions

add_environment(database)

Complete the environment table with the current environment.

get_idle([duration])

Measure the idle consumption.

Details

mendevi.database.complete.add_environment(database: Cursor | str | bytes | Path) int[source]

Complete the environment table with the current environment.

Parameters

databasepathlike

The path of the existing database to be updated.

Returns

idint

The primary key of the freshly updated environment table.

mendevi.database.complete.get_idle(duration: float = 60.0) dict[source]

Measure the idle consumption.

Parameters

durationfloat, default=60

The total duration of the measurement, bloking time in second.

Returns

measuresdict

Same as mendevi.measures.Activity.

Examples

>>> from pprint import pprint
>>> from mendevi.database.complete import get_idle
>>> idle = get_idle(duration=1.0)
>>> pprint(idle)
{'duration': 1.0...,
 'ps_core': [[...],
              ...
              [...]],
 'ps_core_avg': ...,
 'ps_dt': [...],
 'ps_ram': [...],
 'ps_temp': {...},
 'rapl_dt': [...],
 'rapl_power': [...],
 'rapl_power_avg': ...,
 'start': ...}
>>>