func (h *HealthPingRTTS) GetWithCache() *HealthPingStats {
	lastPutAt := h.rtts[h.idx].time
	now := time.Now()
	if h.stats == nil || h.lastUpdateAt.Before(lastPutAt) || h.findOutdated(now) >= 0 {
		h.stats = h.getStatistics()
		h.lastUpdateAt = now
	}
	return h.stats
}
GetWithCache get statistics and write cache for next call
Make sure use Mutex.Lock() before calling it, RWMutex.RLock()
is not an option since it writes cache
package burst
import (
	"math"
	"time"
)
type HealthPingStats struct {
	All       int
	Fail      int
	Deviation time.Duration
	Average   time.Duration
	Max       time.Duration
	Min       time.Duration
}
type HealthPingRTTS struct {
	idx      int
	cap      int
	validity time.Duration
	rtts     []*pingRTT
	lastUpdateAt time.Time
	stats        *HealthPingStats
}
type pingRTT struct {
	time  time.Time
	value time.Duration
}
func NewHealthPingResult(cap int, validity time.Duration) *HealthPingRTTS {
	return &HealthPingRTTS{cap: cap, validity: validity}
}
func (h *HealthPingRTTS) Get() *HealthPingStats {
	return h.getStatistics()
}