athena_rs 3.26.2

Hyper performant polyglot Database driver
Documentation
//! `/debug/schema` summary response contracts.
//!
//! This module owns the aggregate health summary payload type independently
//! from summary metric computation logic.

use serde::Serialize;

/// One machine-readable reason contributing to overall debug health.
#[derive(Debug, Clone, Serialize)]
pub struct LoggingSchemaDebugHealthReason {
    /// Stable reason code (`missing_required_tables`, etc.).
    pub code: String,
    /// Severity classification for this reason (`info`, `warning`, `error`).
    pub severity: String,
    /// Count associated with this reason.
    pub count: usize,
    /// Human-readable explanation for operators.
    pub message: String,
}

/// Health aggregate for `/debug/schema` diagnostics.
#[derive(Debug, Clone, Serialize)]
pub struct LoggingSchemaDebugSummary {
    /// Overall health status (`healthy`, `warning`, `degraded`, or `unhealthy`).
    pub health: String,
    /// Structured reasons explaining why the current health status was assigned.
    pub health_reasons: Vec<LoggingSchemaDebugHealthReason>,
    /// Number of expected table specs.
    pub expected_table_count: usize,
    /// Number of expected tables that were found.
    pub found_table_count: usize,
    /// Number of required tables that were not found.
    pub required_missing_table_count: usize,
    /// Number of optional tables that were not found.
    pub optional_missing_table_count: usize,
    /// Number of required columns that were not found.
    pub required_missing_column_count: usize,
    /// Number of optional columns that were not found.
    pub optional_missing_column_count: usize,
    /// Number of expected relations whose discovered relation type mismatched.
    pub relation_type_mismatch_count: usize,
}