Function: calculateSiteMonitoringStatus()
calculateSiteMonitoringStatus(
site:SiteForStatus):"running"|"stopped"|"partial"
Defined in: shared/utils/siteStatus.ts:65
Calculates the overall monitoring state for a site based on its monitors.
Parametersโ
siteโ
The SiteForStatus object representing the site to evaluate.
Returnsโ
"running" | "stopped" | "partial"
The monitoring state: "running", "stopped", or "partial".
Remarksโ
The monitoring state reflects whether all, some, or none of the site's monitors are actively monitoring.
- Returns
"running"if all monitors are actively monitoring. - Returns
"stopped"if no monitors are actively monitoring or if there are no monitors. - Returns
"partial"if some monitors are monitoring and some are not.
Exampleโ
const status = calculateSiteMonitoringStatus(site);
// status: "running" | "stopped" | "partial"