lightspeed/pipeline/slo

ETL SLO budget contracts for lag/throughput/retry/replay recovery.

Types

One ETL SLO budget profile.

pub type Budget {
  Budget(
    profile: String,
    max_lag_ms: Int,
    min_throughput_records_per_sec: Int,
    max_retry_rate_percent: Int,
    max_replay_recovery_ms: Int,
  )
}

Constructors

  • Budget(
      profile: String,
      max_lag_ms: Int,
      min_throughput_records_per_sec: Int,
      max_retry_rate_percent: Int,
      max_replay_recovery_ms: Int,
    )

One budget check result.

pub type BudgetResult {
  BudgetResult(profile: String, passed: Bool, reason: String)
}

Constructors

  • BudgetResult(profile: String, passed: Bool, reason: String)

One measured ETL observation.

pub type Observation {
  Observation(
    profile: String,
    lag_ms: Int,
    throughput_records_per_sec: Int,
    retry_count: Int,
    processed_records: Int,
    replay_recovery_ms: Int,
  )
}

Constructors

  • Observation(
      profile: String,
      lag_ms: Int,
      throughput_records_per_sec: Int,
      retry_count: Int,
      processed_records: Int,
      replay_recovery_ms: Int,
    )

Values

pub fn budget(
  profile: String,
  max_lag_ms: Int,
  min_throughput_records_per_sec: Int,
  max_retry_rate_percent: Int,
  max_replay_recovery_ms: Int,
) -> Budget

Build one SLO budget profile.

pub fn budget_failures(results: List(BudgetResult)) -> Int

Count budget failures.

pub fn budget_result_label(result: BudgetResult) -> String

Stable budget-result label.

pub const budget_version: Int
pub fn budget_version_label() -> String

Versioned M33 budget profile label.

pub fn default_budget() -> List(Budget)

Default M33 ETL SLO budget profile list.

pub fn evaluate(
  observations: List(Observation),
  budgets: List(Budget),
) -> List(BudgetResult)

Evaluate one observation set against one budget list.

pub fn observation(
  profile: String,
  lag_ms: Int,
  throughput_records_per_sec: Int,
  retry_count: Int,
  processed_records: Int,
  replay_recovery_ms: Int,
) -> Observation

Build one ETL observation.

pub fn observation_label(observation: Observation) -> String

Stable observation label.

pub fn retry_rate_percent(observation: Observation) -> Int

Retry-rate percentage derived from retry count and processed records.

pub fn valid_budget(budget: Budget) -> Bool

Validate one budget profile.

pub fn valid_budgets(budgets: List(Budget)) -> Bool

Validate a budget list and enforce unique profile names.

pub fn valid_observation(observation: Observation) -> Bool

Validate one observation.

Search Document