#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct Memory {
pub used: u64,
pub total: u64,
pub percentage_used: f64,
pub used_hot: u64,
pub percentage_used_hot: f32,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct CPU {
pub nanoseconds: u64,
pub cpus: f64,
pub shares: u64,
pub percentage_used: f64,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct ContainerLayer {
pub size: u64,
pub used: u64,
pub free: u64,
pub percentage_used: f64,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct ContainerMetric {
pub service_instance: String,
pub container: String,
pub memory: Memory,
pub cpu: CPU,
pub container_layer: Option<ContainerLayer>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct GatewayNetwork {
pub tx_packets: Option<u64>,
pub tx_bytes: Option<u64>,
pub rx_packets: Option<u64>,
pub rx_bytes: Option<u64>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
#[non_exhaustive]
pub struct ApplicationMetric {
pub gateway_network: Option<GatewayNetwork>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct MetricEntry {
pub time: chrono::DateTime<chrono::Utc>,
pub host: String,
pub application: String,
pub per_container: Option<ContainerMetric>,
pub per_application: Option<ApplicationMetric>,
}
#[derive(Debug, Clone, serde::Deserialize)]
#[non_exhaustive]
pub struct Metrics {
pub tenant: String,
pub site: String,
pub entries: Vec<MetricEntry>,
}
#[cfg(test)]
mod tests {}