Skip to main content

windmill_api/models/
database_health.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.633.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// DatabaseHealth : Database health status
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DatabaseHealth {
17    /// Whether the database is reachable
18    #[serde(rename = "healthy")]
19    pub healthy: bool,
20    /// Database query latency in milliseconds
21    #[serde(rename = "latency_ms")]
22    pub latency_ms: i64,
23    #[serde(rename = "pool")]
24    pub pool: Box<models::PoolStats>,
25}
26
27impl DatabaseHealth {
28    /// Database health status
29    pub fn new(healthy: bool, latency_ms: i64, pool: models::PoolStats) -> DatabaseHealth {
30        DatabaseHealth {
31            healthy,
32            latency_ms,
33            pool: Box::new(pool),
34        }
35    }
36}
37