lisa.pelt.simulate_pelt#
- lisa.pelt.simulate_pelt(activations, init=0, index=None, clock=None, capacity=None, windowless=False, window=0.001048576, half_life=32, scale=1024)[source]#
Simulate a PELT signal out of a series of activations.
- Parameters:
activations (pandas.Series) – Series of a task’s activations:
1 == running
and0 == sleeping
.init (float) – Initial value of the signal
index (pandas.Index) – Optional index at which the PELT values should be computed. If
None
, a value will be computed when the task starts sleeping and when it wakes up. Note that there is no emulation of scheduler tick updating the signal while it’s running.clock (pandas.Series) – Series of clock values to be used instead of the timestamp index.
capacity (pandas.Series or None) – Capacity of the CPU at all points. This is used to fixup the clock on enqueue and dequeue, since the clock is typically provided by a PELT event and not the enqueue or dequeue events. If no clock at all is passed, the CPU capacity will be used to create one from scratch based on the
activations
index values.window (float) – PELT window in seconds.
windowless (bool) – If
True
, a windowless simulator is used. This avoids the artifacts of the windowing in PELT.half_life (int) – PELT half-life in number of windows.
scale (float) – Scale of the signal, i.e. maximum value it can take.
Note
PELT windowing is not time-invariant, i.e. it depends on the absolute value of the timestamp. This means that the timestamp of the activations matters, and it is recommended to use the
clock
parameter to provide the actual clock used by PELT.Also note that the kernel uses integer arithmetic with a different way of computing the signal. This means that the simulation cannot perfectly match the kernel’s signal.