TracerHook

class passengersim.callbacks.base.TracerHook(tracer: GenericTracer, hook: str)[source]

Bases: object

One hook method of a tracer, as registered on that hook.

A tracer written with on_<hook> methods is registered once per hook, each registration holding one of these. All of them call the same tracer object, so the tracer’s state is never split across copies. The priority and skip_burn settings are read from the tracer, so the scheduler and dispatcher treat this exactly like a legacy tracer.

A tracer has one priority, which times all of its queued hooks (begin_sample, daily, and end_sample) alike, so it observes every DCP from the same side of the RM systems and bookkeeping. Where two of its hooks share a timestamp (the first DCP’s begin-sample and daily calls, or the final DCP’s daily and end-sample calls), they run in lifecycle order, as all callbacks sharing a timestamp do (see CallbackMixin.add_callback_events()).

Methods

__init__(tracer, hook)

Attributes

hook

The lifecycle hook this method runs on.

tracer

The tracer whose method is called.

priority

The tracer's offset in seconds, read when events are scheduled.

skip_burn

Whether the tracer is skipped during burn-in samples.

tracer

The tracer whose method is called.

hook

The lifecycle hook this method runs on.

property priority : Any

The tracer’s offset in seconds, read when events are scheduled.

property skip_burn : bool

Whether the tracer is skipped during burn-in samples.