code: func (c *Client) latencyFilter(node string, rttSeconds float64) float64 {
  	samples, ok := c.latencyFilterSamples[node]
  	if !ok {
  		samples = make([]float64, 0, c.config.LatencyFilterSize)
  	}
  
  	// Add the new sample and trim the list, if needed.
  	samples = append(samples, rttSeconds)
  	if len(samples) > int(c.config.LatencyFilterSize) {
  		samples = samples[1:]
  	}
  	c.latencyFilterSamples[node] = samples
  
  	// Sort a copy of the samples and return the median.
  	sorted := make([]float64, len(samples))
  	copy(sorted, samples)
  	sort.Float64s(sorted)
  	return sorted[len(sorted)/2]
  }
docs: // latencyFilter applies a simple moving median filter with a new sample for
  // a node. This assumes that the mutex has been locked already.