Package haizea :: Package core :: Module accounting :: Class AccountingProbe
[hide private]
[frames] | no frames]

Class AccountingProbe

source code


Base class for accounting probes

Accounting probes must extend this class, and can override some of the methods to make sure the accounting framework runs the probe at certain points (see method documentation for details on when to override a method).

Instance Methods [hide private]
 
__init__(self, accounting)
Constructor
source code
 
finalize_accounting(self)
Finalize data collection.
source code
 
at_timestep(self, lease_scheduler)
Collect data at a timestep.
source code
 
at_lease_request(self, lease)
Collect data after a lease request.
source code
 
at_lease_done(self, lease)
Collect data when a lease is done (this includes successful completion and rejected/cancelled/failed leases).
source code
 
_set_stat_from_counter(self, stat_id, counter_id)
Convenience function that sets the value of a per-run stat with the last value of a counter.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, accounting)
(Constructor)

source code 

Constructor

Child classes must use their constructors to create counters (with AccountingDataCollection.create_counter) and specify per-lease data (with AccountingDataCollection.create_lease_stat) and per-run data (with AccountingDataCollection.create_stat).

Overrides: object.__init__

finalize_accounting(self)

source code 

Finalize data collection.

Override this method to perform any actions when data collection stops. This is usually where per-run data is computed.

at_timestep(self, lease_scheduler)

source code 

Collect data at a timestep.

Override this method to perform any actions every time the Haizea scheduler wakes up.

Parameters:

at_lease_request(self, lease)

source code 

Collect data after a lease request.

Override this method to perform any actions after a lease has been requested.

Parameters:
  • lease (Lease) - Requested lease

at_lease_done(self, lease)

source code 

Collect data when a lease is done (this includes successful completion and rejected/cancelled/failed leases).

Parameters:
  • lease (Lease) - Lease that was completed

_set_stat_from_counter(self, stat_id, counter_id)

source code 

Convenience function that sets the value of a per-run stat with the last value of a counter.

Parameters:
  • stat_id (str) - Name of per-run stat
  • counter_id (str) - Name of counter