MCPcopy
hub / github.com/sourcegraph/checkup / conclude

Method conclude

check/dns/dns.go:109–132  ·  view source on GitHub ↗

conclude takes the data in result from the attempts and computes remaining values needed to fill out the result. It detects degraded (high-latency) responses and makes the conclusion about the result's status.

(result types.Result)

Source from the content-addressed store, hash-verified

107// It detects degraded (high-latency) responses and makes
108// the conclusion about the result's status.
109func (c Checker) conclude(result types.Result) types.Result {
110 result.ThresholdRTT = c.ThresholdRTT
111
112 // Check errors (down)
113 for i := range result.Times {
114 if result.Times[i].Error != "" {
115 result.Down = true
116 return result
117 }
118 }
119
120 // Check round trip time (degraded)
121 if c.ThresholdRTT > 0 {
122 stats := result.ComputeStats()
123 if stats.Median > c.ThresholdRTT {
124 result.Notice = fmt.Sprintf("median round trip time exceeded threshold (%s)", c.ThresholdRTT)
125 result.Degraded = true
126 return result
127 }
128 }
129
130 result.Healthy = true
131 return result
132}

Callers 1

CheckMethod · 0.95

Implementers 6

fakecheckup_test.go
Checkercheck/http/http.go
Checkercheck/dns/dns.go
Checkercheck/exec/exec.go
Checkercheck/tls/tls.go
Checkercheck/tcp/tcp.go

Calls 1

ComputeStatsMethod · 0.80

Tested by

no test coverage detected