LCOV - code coverage report
Current view: top level - compute_tools/src/http/routes - insights.rs (source / functions) Coverage Total Hit
Test: 5fe7fa8d483b39476409aee736d6d5e32728bfac.info Lines: 0.0 % 8 0
Test Date: 2025-03-12 16:10:49 Functions: 0.0 % 2 0

            Line data    Source code
       1              : use std::sync::Arc;
       2              : 
       3              : use axum::extract::State;
       4              : use axum::response::Response;
       5              : use compute_api::responses::ComputeStatus;
       6              : use http::StatusCode;
       7              : 
       8              : use crate::compute::ComputeNode;
       9              : use crate::http::JsonResponse;
      10              : 
      11              : /// Collect current Postgres usage insights.
      12            0 : pub(in crate::http) async fn get_insights(State(compute): State<Arc<ComputeNode>>) -> Response {
      13            0 :     let status = compute.get_status();
      14            0 :     if status != ComputeStatus::Running {
      15            0 :         return JsonResponse::invalid_status(status);
      16            0 :     }
      17              : 
      18            0 :     let insights = compute.collect_insights().await;
      19            0 :     JsonResponse::success(StatusCode::OK, insights)
      20            0 : }
        

Generated by: LCOV version 2.1-beta