events property
int
get
events
The current count of Targeted Events tracked by the lifecycle policy.
This property represents a specialized counter used to determine the
operational health or lifespan of the cell. Depending on the
onEvent logic defined by the user, events may represent:
- Faulty/Rejected Events: A "Error Budget" that increments when a policy guard or filter rejects a pulse.
- Processed Cycles: A "Usage Quota" that increments with every successful signal transformation.
- Custom Signal Matches: A count of specific semantic patterns
detected within the pulse
payload.
Human Developer Usage
Monitor this value to track cell health:
final policy = EphemeralPolicy(
eventLimit: 10,
onEvent: (object, {required cell, policy, arguments, user}) {
print('Current events: ${policy.events}');
return (events: policy.events + 1);
},
// ... onInvalidate
);
Implementation
int get events => _record.events.value ?? 0;