1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! 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>,
}