diff --git a/compute_tools/src/http/api.rs b/compute_tools/src/http/api.rs index afd9c2fb54..0f4fb0ca51 100644 --- a/compute_tools/src/http/api.rs +++ b/compute_tools/src/http/api.rs @@ -30,6 +30,7 @@ fn status_response_from_state(state: &ComputeState) -> ComputeStatusResponse { status: state.status, last_active: state.last_active, error: state.error.clone(), + metrics: state.metrics.clone(), } } diff --git a/libs/compute_api/src/responses.rs b/libs/compute_api/src/responses.rs index f2865b71ec..291b3fa511 100644 --- a/libs/compute_api/src/responses.rs +++ b/libs/compute_api/src/responses.rs @@ -21,6 +21,7 @@ pub struct ComputeStatusResponse { #[serde(serialize_with = "rfc3339_serialize")] pub last_active: Option>, pub error: Option, + pub metrics: ComputeMetrics, } #[derive(Deserialize, Serialize)] @@ -66,7 +67,7 @@ where } /// Response of the /metrics.json API -#[derive(Clone, Debug, Default, Serialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct ComputeMetrics { pub wait_for_spec_ms: u64, pub sync_safekeepers_ms: u64,