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 queryorg_id
- ID of the organizationdays
- Number of days to look back for statistics
§Returns
Ok(JsonValue)
- JSON object with alert statisticsErr(anyhow::Error)
- Failed to fetch alert statistics