MCPcopy Create free account
hub / github.com/encodeous/nylon / StabilizedPing

Method StabilizedPing

state/endpoint.go:271–278  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269}
270
271func (u *NylonEndpoint) StabilizedPing() time.Duration {
272 l, m, h := u.calcR()
273 // don't change median unless it is out of the range of l <= h
274 if l > u.prevMedian || h < u.prevMedian {
275 u.prevMedian = m
276 }
277 return u.prevMedian
278}
279
280func (u *NylonEndpoint) UpdatePing(ping time.Duration) {
281 u.Lock()

Callers 3

MetricMethod · 0.95
buildEndpointsFunction · 0.80
runTestsFunction · 0.80

Calls 1

calcRMethod · 0.95

Tested by 1

runTestsFunction · 0.64