athena_rs 3.26.2

Hyper performant polyglot Database driver
Documentation
//! Data contracts for health endpoint payloads.
//!
//! This module centralizes shared health payload structs so endpoint handlers
//! and health helper modules can reference a stable contract without coupling
//! to route implementation files.

use serde::{Deserialize, Serialize};

use crate::api::health_capabilities::ClusterCapabilities;

/// Health probe details for one configured cluster mirror.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClusterMirrorHealth {
    /// Mirror base URL.
    pub url: String,
    /// Connectivity status (`online` or `offline`).
    pub status: String,
    /// Measured ping latency in milliseconds when available.
    pub latency_ms: Option<f64>,
    /// Estimated `/openapi.yaml` download speed in bytes/second when available.
    pub download_bytes_per_sec: Option<f64>,
    /// Remote version string extracted from mirror metadata.
    pub cargo_toml_version: Option<String>,
    /// Optional status message reported by mirror root endpoint.
    pub message: Option<String>,
    /// Capability matrix resolved for this mirror.
    pub capabilities: ClusterCapabilities,
}

/// Aggregated payload returned by `GET /health/cluster`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClusterHealthPayload {
    /// Human-readable cluster-health message.
    pub message: String,
    /// Running Athena version.
    pub version: String,
    /// API availability status marker.
    pub athena_api: String,
    /// Deadpool readiness status marker.
    pub athena_deadpool: String,
    /// Scylla readiness status marker.
    pub athena_scylladb: String,
    /// Gateway auth-store status marker.
    pub gateway_auth_store: String,
    /// Gateway benchmark-client status marker.
    pub gateway_benchmark_client: String,
    /// Cargo/package version echoed for diagnostics.
    pub cargo_toml_version: String,
    /// Local node capability matrix.
    pub capabilities: ClusterCapabilities,
    /// Per-mirror health probe results.
    pub mirrors: Vec<ClusterMirrorHealth>,
}