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