lisa.energy_meter.EnergyMeter#
- class lisa.energy_meter.EnergyMeter(target, res_dir=None)[source]#
Bases:
Loggable,ConfigurableAbstract Base Class of energy meters.
Attributes
CONF_CLASSinheritedConfiguration class associated with the current class.
INIT_KWARGS_KEY_MAPinheritedDictionary of
__init__parameter names to configuration key path.Properties
Methods
Build an instance of
EnergyMeterfrom a configuration object.Get total energy consumption since last
reset().Reset the energy meter.
Get a sample from the energy meter.
check_init_param()inheritedTake the same parameters as
__init__, and check their types according to what is specified in the configuration class.conf_to_init_kwargs()inheritedTurn a configuration object into a dictionary suitable for passing to
__init__as**kwargs.get_logger()inheritedProvides a
logging.Loggernamed aftercls.log_locals()inheritedDebugging aid: log the local variables of the calling function.
Attributes#
- EnergyMeter.CONF_CLASS = None#
Inherited attribute, see
lisa.conf.Configurable.CONF_CLASSConfiguration class associated with the current class.
- EnergyMeter.INIT_KWARGS_KEY_MAP = {}#
Inherited attribute, see
lisa.conf.Configurable.INIT_KWARGS_KEY_MAPDictionary of
__init__parameter names to configuration key path.
Properties#
- property EnergyMeter.logger#
Inherited property, see
lisa.utils.Loggable.loggerConvenience short-hand for
self.get_logger().
Methods#
- classmethod EnergyMeter.from_conf(target, conf, res_dir=None)[source]#
Build an instance of
EnergyMeterfrom a configuration object.- Parameters:
target (lisa.target.Target) – Target to use
conf – Configuration object to use
res_dir (str or None) – Result directory to use
- classmethod EnergyMeter.check_init_param(**kwargs)#
Inherited method, see
lisa.conf.Configurable.check_init_param()Take the same parameters as
__init__, and check their types according to what is specified in the configuration class.
- classmethod EnergyMeter.conf_to_init_kwargs(conf)#
Inherited method, see
lisa.conf.Configurable.conf_to_init_kwargs()Turn a configuration object into a dictionary suitable for passing to
__init__as**kwargs.
- classmethod EnergyMeter.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()Provides a
logging.Loggernamed aftercls.
- classmethod EnergyMeter.log_locals(var_names=None, level='debug')#
Inherited method, see
lisa.utils.Loggable.log_locals()Debugging aid: log the local variables of the calling function.