bobocep.cep.event.history.BoboHistory
- class bobocep.cep.event.history.BoboHistory(events: Dict[str, List[bobocep.cep.event.event.BoboEvent]])[source]
Bases:
bobocep.bobocep.BoboJSONableAn event history.
- __init__(events: Dict[str, List[bobocep.cep.event.event.BoboEvent]])[source]
- Parameters
events – The history of events. Keys are group names. Values are lists of BoboEvent instances associated with a group.
- all_events() Tuple[bobocep.cep.event.event.BoboEvent, ...][source]
- Returns
All history events in a tuple.
- property events: Dict[str, List[bobocep.cep.event.event.BoboEvent]]
- Returns
All history events, indexed by group.
- first() Optional[bobocep.cep.event.event.BoboEvent][source]
- Returns
The BoboEvent with the oldest timestamp, if there is at least one BoboEvent in the history.
- static from_json_dict(d: dict) bobocep.cep.event.history.BoboHistory[source]
- Parameters
d – A JSON dict representation of the history.
- Returns
A new instance of the history.
- static from_json_str(j: str) bobocep.cep.event.history.BoboHistory[source]
- Parameters
j – A JSON str representation of the history.
- Returns
A new instance of the history.
- group(group: str) Tuple[bobocep.cep.event.event.BoboEvent, ...][source]
- Parameters
group – A group name.
- Returns
The BoboEvent instances associated with group.
- last() Optional[bobocep.cep.event.event.BoboEvent][source]
- Returns
The BoboEvent with the most recent timestamp, if there is at least one BoboEvent in the history.