Skip to main content

Variable: SiteAnalyticsUtils

const SiteAnalyticsUtils: { calculateSLA: { actualDowntime: number; allowedDowntime: number; compliant: boolean; deficit: number; }; getAvailabilityStatus: "warning" | "critical" | "excellent" | "good"; getPerformanceStatus: "warning" | "critical" | "excellent" | "good"; }

Defined in: src/hooks/site/useSiteAnalytics.ts:362

Utility functions for common calculations

Type Declarationโ€‹

calculateSLA()โ€‹

calculateSLA(uptime: number, targetSLA: number): { actualDowntime: number; allowedDowntime: number; compliant: boolean; deficit: number; }

Calculate SLA compliance

Parametersโ€‹

uptimeโ€‹

number

targetSLAโ€‹

number = 99.9

Returnsโ€‹

actualDowntimeโ€‹

actualDowntime: number

Actual downtime percentage (0-1)

allowedDowntimeโ€‹

allowedDowntime: number

Allowed downtime percentage for target SLA (0-1)

compliantโ€‹

compliant: boolean

Whether the uptime meets the target SLA

deficitโ€‹

deficit: number

Percentage points below target SLA (0 if compliant)

getAvailabilityStatus()โ€‹

getAvailabilityStatus(uptime: number): "warning" | "critical" | "excellent" | "good"

Get availability status based on uptime percentage

Parametersโ€‹

uptimeโ€‹

number

Uptime percentage (0-100)

Returnsโ€‹

"warning" | "critical" | "excellent" | "good"

Status level based on uptime thresholds

Remarksโ€‹

Thresholds: โ‰ฅ99.9% = excellent, โ‰ฅ99% = good, โ‰ฅ95% = warning, <95% = critical

getPerformanceStatus()โ€‹

getPerformanceStatus(responseTime: number): "warning" | "critical" | "excellent" | "good"

Get performance status based on response time

Parametersโ€‹

responseTimeโ€‹

number

Average response time in milliseconds

Returnsโ€‹

"warning" | "critical" | "excellent" | "good"

Status level based on response time thresholds

Remarksโ€‹

Thresholds: โ‰ค200ms = excellent, โ‰ค500ms = good, โ‰ค1000ms = warning, >1000ms = critical