Skip to content

AutoRollbackMonitor ​

python
AutoRollbackMonitor(config: MetricDropAutoRollbackConfiguration) -> None

Monitors a metric over time and determines when an automatic rollback should be triggered.

Tracks (step, value) pairs and compares the value at the start of the lookback window with the value at the end. If the metric has dropped by more than the configured threshold, a rollback is triggered.

Initialize the AutoRollbackMonitor.

Parameters:

  • config (MetricDropAutoRollbackConfiguration) – The metric drop automatic rollback configuration.

Source

Properties ​

metric ​

python
metric: str

Get the metric tag prefix being monitored.

Returns:

  • str – The metric tag prefix string.

Source

period_steps ​

python
period_steps: int

Get the number of actor steps over which the drop is measured.

Returns:

  • int – The period in actor steps.

Source

rollback_steps ​

python
rollback_steps: int

Get the effective number of steps to roll back by.

Returns:

  • int – The rollback steps (defaults to period_steps if not explicitly set).

Source

Methods ​

mark_rolled_back ​

python
mark_rolled_back(step: int) -> None

Mark that a rollback occurred at the given step, resetting the monitor's history.

Parameters:

  • step (int) – The actor step at which the rollback happened.

Source

record ​

python
record(step: int, value: float) -> None

Record a metric observation at a given actor step.

Parameters:

  • step (int) – The actor step at which the value was observed.
  • value (float) – The metric value.

Source

reset ​

python
reset() -> None

Reset the monitor's history completely.

Source

should_rollback ​

python
should_rollback() -> bool

Check if the metric has dropped enough to warrant a rollback.

Compares the value at the start of the lookback window with the current value. If the metric has dropped by more than the configured threshold, a rollback is triggered.

Returns:

  • bool – True if the current metric value has dropped from the start of the lookback window by more than the configured threshold.

Source