MCPcopy Index your code
hub / github.com/coder/coder / calculateSeverity

Function calculateSeverity

coderd/healthcheck/workspaceproxy.go:126–134  ·  view source on GitHub ↗

calculateSeverity returns: health.SeverityError if all proxies are unhealthy, health.SeverityOK if all proxies are healthy and there are no warnings, health.SeverityWarning otherwise.

(total, healthy, warning int)

Source from the content-addressed store, hash-verified

124// health.SeverityOK if all proxies are healthy and there are no warnings,
125// health.SeverityWarning otherwise.
126func calculateSeverity(total, healthy, warning int) health.Severity {
127 if total == 0 || (total == healthy && warning == 0) {
128 return health.SeverityOK
129 }
130 if healthy == 0 {
131 return health.SeverityError
132 }
133 return health.SeverityWarning
134}

Callers 2

Test_calculateSeverityFunction · 0.85
RunMethod · 0.85

Calls

no outgoing calls

Tested by 1

Test_calculateSeverityFunction · 0.68