ShadowActivationController class

Watches caller-reported metrics for a feature/event that's been shadow-activated (rolled out to a small cohort ahead of a full release) and auto-rolls-back — CLIENT-SIDE, without waiting for an operator — the instant a registered GuardrailDefinition is violated (FEAT-90).

Deliberately a thin glue layer, not a telemetry/statistics engine: reportMetric takes an already-computed numeric reading (an instantaneous value, a rolling average, whatever the caller's own metric means) — this class only owns the threshold check and the rollback trigger, reusing RemoteKillSwitchController.forceKillLocally (added alongside this class) rather than maintaining its own separate kill state.

Cohort bucketing (which players see the shadow-activated feature) is out of scope here — a caller already has ExperimentBucketingService for that; this class only answers "should the feature I already rolled out to that cohort be rolled back right now".

Constructors

ShadowActivationController({required RemoteKillSwitchController killSwitch})

Properties

hashCode → int
The hash code for this object.
no setterinherited
killSwitch → RemoteKillSwitchController
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerGuardrail(String featureId, GuardrailDefinition guardrail) → void
Registers guardrail for featureId. A feature can have several guardrails (e.g. both an earn-rate ceiling and a spend-rate floor); any single violation is enough to trigger rollback.
reportMetric(String featureId, String metricName, double value) → void
Reports 1 value reading for metricName under featureId's shadow-activation cohort. Checks every guardrail registered for featureId whose GuardrailDefinition.metricName matches — the FIRST violation found immediately force-kills featureId via killSwitch (see RemoteKillSwitchController.forceKillLocally) and stops checking; a value within every registered bound is a no-op (never touches killSwitch at all).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited