DVAlerting class
The rule engine.
Constructors
-
DVAlerting({required DVSignalReaders readers, DVNotificationsService notifications = const DVNotificationsService(), Map<
String, DVAlertPager> pagers = const <String, DVAlertPager>{}, DVAlertTeamResolver? teams, DVIncidents? incidents, void onDiagnostic(String code, String message)?})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- incidents → DVIncidents?
-
final
- readers → DVSignalReaders
-
final
-
rules
→ List<
DVAlertRule> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
acknowledge(
String rule, {String? action, required DateTime now}) → void -
Marks the current or latest episode of
ruleacknowledged, recording what was done about it. -
addRule(
DVAlertRule rule) → void -
analyze(
{required DateTime now, Duration window = const Duration(days: 7), int minimumDays = 5}) → Future< List< DVAlertFinding> > -
What
dartvel analyzereports: rules with no target and rules that fire routinely without action (DV-ALERT-005), and rules naming a signal that does not exist (DV-ALERT-006). -
episodes(
String rule) → List< DVAlertEpisode> -
evaluate(
{required DateTime now}) → Future< void> - Samples service levels, reads every rule's signal, and moves each rule through inactive, pending and firing.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pendingResolves(
String rule) → List< String> -
The pagers still owed a resolve for
rule: each refused it, and it stays queued until the pager takes it. -
recordEpisode(
String rule, {required DateTime firedAt, DateTime? resolvedAt, bool acknowledged = false, String? action}) → void - Records a past episode -- history read back from storage.
-
registerPager(
String name, DVAlertPager pager) → void -
start(
{Duration interval = const Duration(minutes: 1)}) → void -
Evaluates every rule on
intervaluntil stop. -
state(
String rule) → DVAlertState -
stop(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- episodeRetention → const Duration
- How long episode history is kept for noise analysis.