github-actions[bot]
Sync from GitHub main @ 51304ea81c450e4e5ce90de52f10a63dcca33c64
7666573
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Literal
PipelineStatus = Literal["ok", "error", "ambiguous"]
RepairOutcome = Literal["attempt", "success", "failed", "skipped"]
class Metrics(ABC):
@abstractmethod
def observe_stage_duration_ms(self, *, stage: str, dt_ms: float) -> None: ...
@abstractmethod
def inc_pipeline_run(self, *, status: PipelineStatus) -> None: ...
@abstractmethod
def inc_stage_call(self, *, stage: str, ok: bool) -> None: ...
@abstractmethod
def inc_stage_error(self, *, stage: str, error_code: str) -> None: ...
@abstractmethod
def inc_repair_trigger(self, *, stage: str, reason: str) -> None: ...
@abstractmethod
def inc_repair_attempt(self, *, stage: str, outcome: RepairOutcome) -> None: ...