Function get_alert_stats

Source
pub async fn get_alert_stats(
    pool: &Pool<MySql>,
    org_id: i64,
    days: i64,
) -> Result<Value>
Expand description

Gets statistics about alerts for an organization grouped by severity and status.

This function retrieves counts of alerts for an organization, grouped by different categories to provide an overview of the alert landscape.

§Arguments

  • pool - Database connection pool for executing the query
  • org_id - ID of the organization
  • days - Number of days to look back for statistics

§Returns

  • Ok(JsonValue) - JSON object with alert statistics
  • Err(anyhow::Error) - Failed to fetch alert statistics