Skip to main content

Function: determineMonitorStatus()

determineMonitorStatus(httpStatus: number): "degraded" | "down" | "up"

Defined in: shared/utils/httpStatusUtils.ts:77

Determines monitor status ("up", "degraded", or "down") from an HTTP status code.

Parametersโ€‹

httpStatusโ€‹

number

The HTTP status code to evaluate (integer).

Returnsโ€‹

"degraded" | "down" | "up"

Up if the site is responding normally, "degraded" if responding certain server issues, "down" if server error or invalid code.

Remarksโ€‹

1xxโ€“4xx: "up" (site is responding)

Used by monitoring services to classify site health with three-state model.

Exampleโ€‹

determineMonitorStatus(200); // "up"
determineMonitorStatus(404); // "up"
determineMonitorStatus(501); // "degraded"
determineMonitorStatus(500); // "down"
determineMonitorStatus(999); // "down"

Seeโ€‹

MDN: HTTP response status codes