moonslokit

SLO, error budget, and burn-rate evaluation primitives for MoonBit.

slo
error-budget
burn-rate
availability
monitoring
moon add Zxy666668/moonslokit@0.2.0
Download zip
Author
Version
0.2.0
License
Apache-2.0
Last updated
yesterday
Downloads
6
README

#MoonSLOKit

CI

MoonSLOKit is a MoonBit foundation library for SLO evaluation, error-budget tracking, and burn-rate alert decisions.

It is intended for service reliability tooling, CI gates, API stability checks, and monitoring dashboards that need deterministic SLO math.

Repository: GitHub · GitLink

#Prerequisites

Install the current MoonBit toolchain (the OSC2026 validation environment uses MoonBit 0.10.3) from the official installation guide. Verify the installation before using the commands below:

moon version --all

#Features

  • SLO target definition in basis points.
  • Request windows with good/bad request counts.
  • Minute-level traffic sample aggregation into request windows.
  • Availability and error-rate calculation.
  • Error-budget consumed and remaining reports.
  • Error-budget exhaustion forecasting.
  • Burn-rate calculation.
  • Burn-rate alert rules with page/ticket decisions.
  • Standard multi-window burn-rate templates.
  • Multi-window evaluation.
  • Release gate decisions for CI and rollout workflows.
  • Service-level objective evaluation.
  • Deploy and incident annotations for explainable windows.
  • Configuration validation with actionable diagnostics.
  • Rolling observation series and request-event aggregation.
  • Incident impact timelines and escalation policy routing.
  • Portfolio-level health summaries and release-readiness reports.
  • Prometheus-style metrics export for dashboards and alerting.
  • Budget projection, compliance scoring, and latency summaries.
  • Stable JSON export and CLI demo.

#Quick Example

///|
test {
let target = SloTarget::new("api", 9900, 30 * 24 * 60)
let window = RequestWindow::new("5m", 5, 1000, 980)
let burn = calculate_burn_rate(target, window)

assert_eq(burn.rate_label(), "2.00x")
}

#Commands

moon check --target all moon test --target wasm moon test --target wasm-gc moon run cmd/main

The repository CI runs the complete cross-backend check and test matrix on Ubuntu, macOS, and Windows. The local equivalent is:

moon update moon check --target all moon test --target all moon fmt && git diff --exit-code moon info && git diff --exit-code

#Boundary

MoonSLOKit is not a metrics collector, storage engine, web server, or dashboard. It provides the reusable SLO math and explainable decision layer that those systems can embed.

#Industrial Scenario

MoonSLOKit now covers a complete small reliability workflow:

  1. Aggregate traffic samples into SLO windows.
  2. Evaluate availability and error-budget consumption.
  3. Compute burn rates across standard short and long windows.
  4. Forecast budget exhaustion from recent traffic.
  5. Produce a release-gate decision for CI or rollout tooling.
  6. Attach deploy or incident annotations to explain window behavior.
  7. Validate configuration and request samples before evaluation.
  8. Aggregate request events into rolling windows and latency summaries.
  9. Export service, portfolio, and health reports as JSON, Markdown, or metrics.

#Install and External Consumer

After the package is published to Mooncakes, create a separate MoonBit project and install it by package name:

moon new slo-consumer cd slo-consumer moon add Zxy666668/moonslokit

The module name is exactly Zxy666668/moonslokit; use that spelling and capitalization in both moon add and the import path.

Use the dependency from the consumer package, not this repository checkout:

///|
import {
"Zxy666668/moonslokit" @slo,
}

///|
fn main {
let target = @slo.SloTarget::new("checkout-api", 9900, 30 * 24 * 60)
let window = @slo.RequestWindow::new("5m", 5, 1000, 980)
println(@slo.evaluate_budget(target, window).to_json())
}

Verify the external consumer with moon run; it should print a JSON budget report. This verifies the published dependency rather than importing files from this checkout. If the package has not yet been published, moon add will fail until the Mooncakes release is available.

#
AlertChannel

pub(all) enum AlertChannel {
Pager
Ticketing
Log
} derive(Eq,
Debug
)

#
AlertDecision

pub(all) struct AlertDecision {
level : AlertLevel
rule_name : String
burn_rate_x100 : Int
reason : String
} derive(Eq,
Debug
)

#
AlertDecision::is_alert

fn AlertDecision::is_alert(self : AlertDecision) -> Bool

#
AlertDecision::level_name

fn AlertDecision::level_name(self : AlertDecision) -> String

#
AlertDecision::to_json

fn AlertDecision::to_json(self : AlertDecision) -> String

#
AlertLevel

pub(all) enum AlertLevel {
Ok
Page
Ticket
} derive(Eq,
Debug
)

#
AlertLevel::name

fn AlertLevel::name(self : AlertLevel) -> String

#
AlertRoute

pub(all) struct AlertRoute {
level : AlertLevel
channel : AlertChannel
destination : String
} derive(Eq,
Debug
)

#
AlertRoute::channel_name

fn AlertRoute::channel_name(self : AlertRoute) -> String

#
AlertRoute::new

fn AlertRoute::new(level : AlertLevel, channel : AlertChannel, destination : String) -> AlertRoute

#
AnnotatedWindow

pub(all) struct AnnotatedWindow {
window : RequestWindow
annotations : Array[SloAnnotation]
} derive(Eq,
Debug
)

#
AnnotatedWindow::has_kind

fn AnnotatedWindow::has_kind(self : AnnotatedWindow, kind : String) -> Bool

#
BudgetForecast

pub(all) struct BudgetForecast {
report : BudgetReport
lookback_minutes : Int
bad_per_hour_x100 : Int
minutes_to_exhaustion : Int
state : String
} derive(Eq,
Debug
)

#
BudgetForecast::exhausted

fn BudgetForecast::exhausted(self : BudgetForecast) -> Bool

#
BudgetForecast::to_json

fn BudgetForecast::to_json(self : BudgetForecast) -> String

#
BudgetProjection

pub(all) struct BudgetProjection {
target : SloTarget
current : BudgetReport
projected_bad : Int
projected_total : Int
projected_consumed_bp : Int
remaining_after_projection : Int
status : String
} derive(Eq,
Debug
)

#
BudgetProjection::safe

fn BudgetProjection::safe(self : BudgetProjection) -> Bool

#
BudgetProjection::status_name

fn BudgetProjection::status_name(self : BudgetProjection) -> String

#
BudgetProjection::to_json

fn BudgetProjection::to_json(self : BudgetProjection) -> String

#
BudgetReport

pub(all) struct BudgetReport {
target : SloTarget
window : RequestWindow
allowed_bad : Int
actual_bad : Int
consumed_bp : Int
remaining_bad : Int
} derive(Eq,
Debug
)

#
BudgetReport::budget_status

fn BudgetReport::budget_status(self : BudgetReport) -> String

#
BudgetReport::healthy

fn BudgetReport::healthy(self : BudgetReport) -> Bool

#
BudgetReport::remaining_ratio_bp

fn BudgetReport::remaining_ratio_bp(self : BudgetReport) -> Int

#
BudgetReport::to_json

fn BudgetReport::to_json(self : BudgetReport) -> String

#
BudgetReport::to_metrics

fn BudgetReport::to_metrics(self : BudgetReport, service : String) -> String

#
BurnReport

pub(all) struct BurnReport {
window : RequestWindow
allowed_error_bp : Int
observed_error_bp : Int
burn_rate_x100 : Int
} derive(Eq,
Debug
)

#
BurnReport::rate_label

fn BurnReport::rate_label(self : BurnReport) -> String

#
BurnReport::to_json

fn BurnReport::to_json(self : BurnReport) -> String

#
BurnReport::to_metrics

fn BurnReport::to_metrics(self : BurnReport, service : String) -> String

#
BurnRule

pub(all) struct BurnRule {
name : String
level : AlertLevel
threshold_x100 : Int
} derive(Eq,
Debug
)

#
BurnRule::new

fn BurnRule::new(name : String, level : AlertLevel, threshold_x100 : Int) -> BurnRule

#
EscalationPolicy

pub(all) struct EscalationPolicy {
name : String
routes : Array[AlertRoute]
default_route : AlertRoute
} derive(Eq,
Debug
)

#
EscalationPolicy::has_channel

fn EscalationPolicy::has_channel(self : EscalationPolicy, channel : AlertChannel) -> Bool

#
EscalationPolicy::new

fn EscalationPolicy::new(name : String, routes : Array[AlertRoute]) -> EscalationPolicy

#
EscalationPolicy::route

#
EscalationPolicy::route_count

fn EscalationPolicy::route_count(self : EscalationPolicy) -> Int

#
EscalationPolicy::route_for_level

fn EscalationPolicy::route_for_level(self : EscalationPolicy, level : AlertLevel) -> AlertRoute

#
EscalationPolicy::routes_for

fn EscalationPolicy::routes_for(self : EscalationPolicy, level : AlertLevel) -> Array[AlertRoute]

#
EscalationPolicy::to_json

fn EscalationPolicy::to_json(self : EscalationPolicy) -> String

#
GateDecision

pub(all) struct GateDecision {
gate_name : String
allowed : Bool
reason : String
consumed_bp : Int
highest_level : AlertLevel
} derive(Eq,
Debug
)

#
GateDecision::to_json

fn GateDecision::to_json(self : GateDecision) -> String

#
HealthReport

pub(all) struct HealthReport {
service : String
target : SloTarget
statistics : WindowStatistics
latest : BudgetReport
peak_burn_x100 : Int
incident_count : Int
severity : ReportSeverity
incidents : IncidentTimeline
} derive(Eq,
Debug
)

#
HealthReport::from_windows

fn HealthReport::from_windows(service : String, target : SloTarget, windows : Array[RequestWindow], incidents : IncidentTimeline) -> HealthReport

#
HealthReport::healthy

fn HealthReport::healthy(self : HealthReport) -> Bool

#
HealthReport::recommendation

fn HealthReport::recommendation(self : HealthReport) -> String

#
HealthReport::risk_score

fn HealthReport::risk_score(self : HealthReport) -> Int

#
HealthReport::severity_name

fn HealthReport::severity_name(self : HealthReport) -> String

#
HealthReport::to_json

fn HealthReport::to_json(self : HealthReport) -> String

#
HealthReport::to_markdown

fn HealthReport::to_markdown(self : HealthReport) -> String

#
HealthReport::to_metrics

fn HealthReport::to_metrics(self : HealthReport) -> String

#
Incident

pub(all) struct Incident {
id : String
started_minute : Int
ended_minute : Int
severity : IncidentSeverity
title : String
impact_bp : Int
} derive(Eq,
Debug
)

#
Incident::active_at

fn Incident::active_at(self : Incident, minute : Int) -> Bool

#
Incident::duration

fn Incident::duration(self : Incident) -> Int

#
Incident::new

fn Incident::new(id : String, started_minute : Int, ended_minute : Int, severity : IncidentSeverity, title : String, impact_bp : Int) -> Incident

#
Incident::severity_name

fn Incident::severity_name(self : Incident) -> String

#
IncidentSeverity

pub(all) enum IncidentSeverity {
Info
Warning
Critical
} derive(Eq,
Debug
)

#
IncidentTimeline

pub(all) struct IncidentTimeline {
incidents : Array[Incident]
} derive(Eq,
Debug
)

#
IncidentTimeline::active_at

fn IncidentTimeline::active_at(self : IncidentTimeline, minute : Int) -> Bool

#
IncidentTimeline::active_count

fn IncidentTimeline::active_count(self : IncidentTimeline, minute : Int) -> Int

#
IncidentTimeline::count

fn IncidentTimeline::count(self : IncidentTimeline) -> Int

#
IncidentTimeline::impact_at

fn IncidentTimeline::impact_at(self : IncidentTimeline, minute : Int) -> Int

#
IncidentTimeline::impact_average

fn IncidentTimeline::impact_average(self : IncidentTimeline, start_minute : Int, end_minute : Int) -> Int

#
IncidentTimeline::new

#
IncidentTimeline::overlap_count

fn IncidentTimeline::overlap_count(self : IncidentTimeline, start_minute : Int, end_minute : Int) -> Int

#
IncidentTimeline::record

#
IncidentTimeline::severity_at

fn IncidentTimeline::severity_at(self : IncidentTimeline, minute : Int) -> IncidentSeverity

#
IncidentTimeline::to_json

fn IncidentTimeline::to_json(self : IncidentTimeline) -> String

#
LatencySummary

pub(all) struct LatencySummary {
count : Int
average_ms : Int
min_ms : Int
max_ms : Int
slow_count : Int
} derive(Eq,
Debug
)

#
LatencySummary::empty

#
LatencySummary::healthy

fn LatencySummary::healthy(self : LatencySummary, budget_ms : Int) -> Bool

#
LatencySummary::to_json

fn LatencySummary::to_json(self : LatencySummary) -> String

#
MultiWindowReport

pub(all) struct MultiWindowReport {
target : SloTarget
reports : Array[BurnReport]
decisions : Array[AlertDecision]
} derive(Eq,
Debug
)

#
MultiWindowReport::highest_level

fn MultiWindowReport::highest_level(self : MultiWindowReport) -> AlertLevel

#
ObservationSeries

pub(all) struct ObservationSeries {
name : String
window_minutes : Int
samples : Array[TrafficSample]
} derive(Eq,
Debug
)

#
ObservationSeries::add

#
ObservationSeries::budget_reports

fn ObservationSeries::budget_reports(self : ObservationSeries, target : SloTarget) -> Array[BudgetReport]

#
ObservationSeries::burn_reports

fn ObservationSeries::burn_reports(self : ObservationSeries, target : SloTarget) -> Array[BurnReport]

#
ObservationSeries::coverage_minutes

fn ObservationSeries::coverage_minutes(self : ObservationSeries) -> Int

#
ObservationSeries::first_minute

fn ObservationSeries::first_minute(self : ObservationSeries) -> Int

#
ObservationSeries::from_samples

fn ObservationSeries::from_samples(name : String, window_minutes : Int, samples : Array[TrafficSample]) -> ObservationSeries

#
ObservationSeries::is_continuous

fn ObservationSeries::is_continuous(self : ObservationSeries) -> Bool

#
ObservationSeries::last_minute

fn ObservationSeries::last_minute(self : ObservationSeries) -> Int

#
ObservationSeries::new

fn ObservationSeries::new(name : String, window_minutes : Int) -> ObservationSeries

#
ObservationSeries::peak_burn

fn ObservationSeries::peak_burn(self : ObservationSeries, target : SloTarget) -> Int

#
ObservationSeries::sample_count

fn ObservationSeries::sample_count(self : ObservationSeries) -> Int

#
ObservationSeries::to_json

fn ObservationSeries::to_json(self : ObservationSeries) -> String

#
ObservationSeries::window_at

fn ObservationSeries::window_at(self : ObservationSeries, now_minute : Int) -> RequestWindow

#
ObservationSeries::window_from

fn ObservationSeries::window_from(self : ObservationSeries, start_minute : Int, end_minute : Int) -> RequestWindow

#
ObservationSeries::windows

#
PortfolioSummary

pub(all) struct PortfolioSummary {
portfolio : String
service_count : Int
healthy_count : Int
unhealthy_count : Int
total_requests : Int
total_bad : Int
availability_bp : Int
} derive(Eq,
Debug
)

#
PortfolioSummary::healthy

fn PortfolioSummary::healthy(self : PortfolioSummary) -> Bool

#
PortfolioSummary::to_json

fn PortfolioSummary::to_json(self : PortfolioSummary) -> String

#
PortfolioSummary::to_metrics

fn PortfolioSummary::to_metrics(self : PortfolioSummary) -> String

#
ReleaseGate

pub(all) struct ReleaseGate {
name : String
max_consumed_bp : Int
allow_ticket : Bool
} derive(Eq,
Debug
)

#
ReleaseGate::new

fn ReleaseGate::new(name : String, max_consumed_bp : Int, allow_ticket : Bool) -> ReleaseGate

#
ReliabilityResult

pub(all) struct ReliabilityResult {
id : String
budget : BudgetReport
burn : BurnReport
label : String
recommendation : String
} derive(Eq,
Debug
)

#
ReliabilityResult::approved

fn ReliabilityResult::approved(self : ReliabilityResult) -> Bool

#
ReliabilityResult::status_line

fn ReliabilityResult::status_line(self : ReliabilityResult) -> String

#
ReliabilityResult::to_json

fn ReliabilityResult::to_json(self : ReliabilityResult) -> String

#
ReliabilityRun

pub(all) struct ReliabilityRun {
id : String
target : SloTarget
window : RequestWindow
} derive(Eq,
Debug
)

#
ReliabilityRun::evaluate

#
ReliabilityRun::new

fn ReliabilityRun::new(id : String, target : SloTarget, window : RequestWindow) -> ReliabilityRun

#
ReportSeverity

pub(all) enum ReportSeverity {
Stable
Watch
ActionRequired
Emergency
} derive(Eq,
Debug
)

#
RequestBatch

pub(all) struct RequestBatch {
name : String
events : Array[RequestEvent]
} derive(Eq,
Debug
)

#
RequestBatch::add

#
RequestBatch::failed

fn RequestBatch::failed(self : RequestBatch) -> Int

#
RequestBatch::latency

fn RequestBatch::latency(self : RequestBatch, slow_after_ms : Int) -> LatencySummary

#
RequestBatch::minutes

fn RequestBatch::minutes(self : RequestBatch) -> Int

#
RequestBatch::new

fn RequestBatch::new(name : String) -> RequestBatch

#
RequestBatch::slow_count

fn RequestBatch::slow_count(self : RequestBatch, slow_after_ms : Int) -> Int

#
RequestBatch::succeeded

fn RequestBatch::succeeded(self : RequestBatch) -> Int

#
RequestBatch::to_json

fn RequestBatch::to_json(self : RequestBatch) -> String

#
RequestBatch::to_series

fn RequestBatch::to_series(self : RequestBatch, window_minutes : Int) -> ObservationSeries

#
RequestBatch::to_window

fn RequestBatch::to_window(self : RequestBatch, minutes : Int) -> RequestWindow

#
RequestBatch::total

fn RequestBatch::total(self : RequestBatch) -> Int

#
RequestEvent

pub(all) struct RequestEvent {
minute : Int
succeeded : Bool
latency_ms : Int
} derive(Eq,
Debug
)

#
RequestEvent::failed

fn RequestEvent::failed(self : RequestEvent) -> Bool

#
RequestEvent::latency_band

fn RequestEvent::latency_band(self : RequestEvent, slow_after_ms : Int) -> String

#
RequestEvent::new

fn RequestEvent::new(minute : Int, succeeded : Bool, latency_ms : Int) -> RequestEvent

#
RequestWindow

pub(all) struct RequestWindow {
name : String
minutes : Int
total : Int
good : Int
} derive(Eq,
Debug
)

#
RequestWindow::availability_bp

fn RequestWindow::availability_bp(self : RequestWindow) -> Int

#
RequestWindow::bad

fn RequestWindow::bad(self : RequestWindow) -> Int

#
RequestWindow::error_bp

fn RequestWindow::error_bp(self : RequestWindow) -> Int

#
RequestWindow::new

fn RequestWindow::new(name : String, minutes : Int, total : Int, good : Int) -> RequestWindow

#
ServiceEvaluation

pub(all) struct ServiceEvaluation {
service : String
target_name : String
budget : BudgetReport
multi_window : MultiWindowReport
gate : GateDecision
} derive(Eq,
Debug
)

#
ServiceEvaluation::healthy

fn ServiceEvaluation::healthy(self : ServiceEvaluation) -> Bool

#
ServiceEvaluation::to_json

fn ServiceEvaluation::to_json(self : ServiceEvaluation) -> String

#
ServiceEvaluation::to_metrics

fn ServiceEvaluation::to_metrics(self : ServiceEvaluation) -> String

#
ServiceObjective

pub(all) struct ServiceObjective {
service : String
target : SloTarget
burn_rules : Array[BurnRule]
} derive(Eq,
Debug
)

#
ServiceObjective::new

fn ServiceObjective::new(service : String, target : SloTarget, burn_rules : Array[BurnRule]) -> ServiceObjective

#
ServiceSnapshot

pub(all) struct ServiceSnapshot {
service : String
budget : BudgetReport
} derive(Eq,
Debug
)

#
ServiceSnapshot::availability_bp

fn ServiceSnapshot::availability_bp(self : ServiceSnapshot) -> Int

#
ServiceSnapshot::healthy

fn ServiceSnapshot::healthy(self : ServiceSnapshot) -> Bool

#
ServiceSnapshot::new

fn ServiceSnapshot::new(service : String, budget : BudgetReport) -> ServiceSnapshot

#
SloAnnotation

pub(all) struct SloAnnotation {
minute : Int
kind : String
message : String
} derive(Eq,
Debug
)

#
SloAnnotation::new

fn SloAnnotation::new(minute : Int, kind : String, message : String) -> SloAnnotation

#
SloAnnotation::to_json

fn SloAnnotation::to_json(self : SloAnnotation) -> String

#
SloConfig

pub(all) struct SloConfig {
target : SloTarget
windows : Array[WindowPolicy]
rules : Array[BurnRule]
} derive(Eq,
Debug
)

#
SloConfig::has_rule

fn SloConfig::has_rule(self : SloConfig, name : String) -> Bool

#
SloConfig::has_window

fn SloConfig::has_window(self : SloConfig, name : String) -> Bool

#
SloConfig::new

fn SloConfig::new(target : SloTarget, windows : Array[WindowPolicy], rules : Array[BurnRule]) -> SloConfig

#
SloConfig::required_windows

fn SloConfig::required_windows(self : SloConfig) -> Array[WindowPolicy]

#
SloConfig::rule_count

fn SloConfig::rule_count(self : SloConfig) -> Int

#
SloConfig::to_json

fn SloConfig::to_json(self : SloConfig) -> String

#
SloConfig::window_count

fn SloConfig::window_count(self : SloConfig) -> Int

#
SloPortfolio

pub(all) struct SloPortfolio {
name : String
services : Array[ServiceSnapshot]
} derive(Eq,
Debug
)

#
SloPortfolio::add

#
SloPortfolio::contains

fn SloPortfolio::contains(self : SloPortfolio, service : String) -> Bool

#
SloPortfolio::healthy_count

fn SloPortfolio::healthy_count(self : SloPortfolio) -> Int

#
SloPortfolio::new

fn SloPortfolio::new(name : String) -> SloPortfolio

#
SloPortfolio::service_count

fn SloPortfolio::service_count(self : SloPortfolio) -> Int

#
SloPortfolio::summary

#
SloPortfolio::to_json

fn SloPortfolio::to_json(self : SloPortfolio) -> String

#
SloPortfolio::unhealthy_services

fn SloPortfolio::unhealthy_services(self : SloPortfolio) -> Array[String]

#
SloTarget

pub(all) struct SloTarget {
name : String
target_bp : Int
period_minutes : Int
} derive(Eq,
Debug
)

#
SloTarget::allowed_error_bp

fn SloTarget::allowed_error_bp(self : SloTarget) -> Int

#
SloTarget::new

fn SloTarget::new(name : String, target_bp : Int, period_minutes : Int) -> SloTarget

#
SloTarget::to_metrics

fn SloTarget::to_metrics(self : SloTarget) -> String

#
TrafficSample

pub(all) struct TrafficSample {
minute : Int
total : Int
good : Int
} derive(Eq,
Debug
)

#
TrafficSample::new

fn TrafficSample::new(minute : Int, total : Int, good : Int) -> TrafficSample

#
ValidationIssue

pub(all) struct ValidationIssue {
code : String
message : String
kind : ValidationKind
} derive(Eq,
Debug
)

#
ValidationKind

pub(all) enum ValidationKind {
EmptyName
InvalidTarget
InvalidWindow
InvalidRule
EmptyCollection
} derive(Eq,
Debug
)

#
ValidationReport

pub(all) struct ValidationReport {
valid : Bool
checked : Int
issues : Array[ValidationIssue]
} derive(Eq,
Debug
)

#
ValidationReport::has_code

fn ValidationReport::has_code(self : ValidationReport, code : String) -> Bool

#
ValidationReport::issue_count

fn ValidationReport::issue_count(self : ValidationReport) -> Int

#
ValidationReport::summary

fn ValidationReport::summary(self : ValidationReport) -> String

#
WindowPolicy

pub(all) struct WindowPolicy {
name : String
minutes : Int
required : Bool
} derive(Eq,
Debug
)

#
WindowPolicy::duration_label

fn WindowPolicy::duration_label(self : WindowPolicy) -> String

#
WindowPolicy::new

fn WindowPolicy::new(name : String, minutes : Int, required : Bool) -> WindowPolicy

#
WindowStatistics

pub(all) struct WindowStatistics {
window_count : Int
total_requests : Int
total_good : Int
total_bad : Int
min_availability_bp : Int
max_availability_bp : Int
average_availability_bp : Int
} derive(Eq,
Debug
)

#
WindowStatistics::error_rate_bp

fn WindowStatistics::error_rate_bp(self : WindowStatistics) -> Int

#
WindowStatistics::from_windows

fn WindowStatistics::from_windows(windows : Array[RequestWindow]) -> WindowStatistics

#
WindowStatistics::healthy

fn WindowStatistics::healthy(self : WindowStatistics, target : SloTarget) -> Bool

#
WindowStatistics::merge

#
WindowStatistics::to_json

fn WindowStatistics::to_json(self : WindowStatistics) -> String

#
aggregate_recent_samples

fn aggregate_recent_samples(name : String, now_minute : Int, window_minutes : Int, samples : Array[TrafficSample]) -> RequestWindow

#
aggregate_samples

fn aggregate_samples(name : String, window_minutes : Int, samples : Array[TrafficSample]) -> RequestWindow

#
annotate_window

fn annotate_window(window : RequestWindow, start_minute : Int, annotations : Array[SloAnnotation]) -> AnnotatedWindow

#
availability_band

fn availability_band(availability_bp : Int) -> String

#
batch_availability_bp

fn batch_availability_bp(batch : RequestBatch) -> Int

#
batch_error_rate_bp

fn batch_error_rate_bp(batch : RequestBatch) -> Int

#
best_window

fn best_window(windows : Array[RequestWindow]) -> RequestWindow

#
budget_headroom

fn budget_headroom(report : BudgetReport) -> Int

#
budget_status_priority

fn budget_status_priority(status : String) -> Int

#
calculate_burn_rate

fn calculate_burn_rate(target : SloTarget, window : RequestWindow) -> BurnReport

#
compare_reports

fn compare_reports(before : HealthReport, after : HealthReport) -> String

#
compliance_label

fn compliance_label(score_bp : Int) -> String

#
compliance_score

fn compliance_score(target : SloTarget, windows : Array[RequestWindow]) -> Int

#
default_slo_config

fn default_slo_config(target : SloTarget) -> SloConfig

#
error_rate_percent

fn error_rate_percent(error_bp : Int) -> String

#
evaluate_budget

fn evaluate_budget(target : SloTarget, window : RequestWindow) -> BudgetReport

#
evaluate_burn_rule

fn evaluate_burn_rule(report : BurnReport, rule : BurnRule) -> AlertDecision

#
evaluate_multi_window

fn evaluate_multi_window(target : SloTarget, windows : Array[RequestWindow], rules : Array[BurnRule]) -> MultiWindowReport

#
evaluate_release_gate

fn evaluate_release_gate(gate : ReleaseGate, budget : BudgetReport, report : MultiWindowReport) -> GateDecision

#
evaluate_release_readiness

fn evaluate_release_readiness(target : SloTarget, current : RequestWindow, recent : Array[RequestWindow]) -> ReliabilityResult

#
evaluate_service_objective

fn evaluate_service_objective(objective : ServiceObjective, budget_window : RequestWindow, burn_windows : Array[RequestWindow], gate : ReleaseGate) -> ServiceEvaluation

#
forecast_budget

fn forecast_budget(target : SloTarget, window : RequestWindow, lookback_minutes : Int) -> BudgetForecast

#
health_label

fn health_label(healthy : Bool) -> String

#
merge_batches

fn merge_batches(left : RequestBatch, right : RequestBatch) -> RequestBatch

#
merge_validation

fn merge_validation(a : ValidationReport, b : ValidationReport) -> ValidationReport

#
metrics_document

fn metrics_document(target : SloTarget, budgets : Array[BudgetReport], service : String) -> String

#
project_budget

fn project_budget(target : SloTarget, current : RequestWindow, additional_total : Int, additional_bad : Int) -> BudgetProjection

#
remaining_budget_ratio_bp

fn remaining_budget_ratio_bp(report : BudgetReport) -> Int

#
report_is_regression

fn report_is_regression(before : HealthReport, after : HealthReport) -> Bool

#
severity_from_score

fn severity_from_score(score : Int) -> ReportSeverity

#
standard_burn_rules

fn standard_burn_rules() -> Array[BurnRule]

#
standard_window_minutes

fn standard_window_minutes() -> Array[Int]

#
standard_window_names

fn standard_window_names() -> Array[String]

#
target_gap_bp

fn target_gap_bp(target : SloTarget, window : RequestWindow) -> Int

#
target_is_met

fn target_is_met(target : SloTarget, window : RequestWindow) -> Bool

#
validate_config

fn validate_config(config : SloConfig) -> ValidationReport

#
validate_rule

fn validate_rule(rule : BurnRule) -> ValidationReport

#
validate_samples

fn validate_samples(samples : Array[TrafficSample]) -> ValidationReport

#
validate_target

fn validate_target(target : SloTarget) -> ValidationReport

#
validate_window

fn validate_window(window : RequestWindow) -> ValidationReport

#
validate_windows

fn validate_windows(windows : Array[RequestWindow]) -> ValidationReport

#
windows_in_range

fn windows_in_range(windows : Array[RequestWindow], start : Int, end : Int) -> Array[RequestWindow]

#
worst_window

fn worst_window(windows : Array[RequestWindow]) -> RequestWindow