Esempio n. 1
0
func (st *Store) initThroughputSampler() {
	st.throughput = stats.NewPeriodicSampler(time.Second, 60, func() stats.Sample {
		st.mutex.Lock()
		s := &ThroughputSample{received: st.bytesReceived, served: st.bytesServed}
		st.mutex.Unlock()
		return s
	})
}
Esempio n. 2
0
func (st *Store) initThroughputSampler() {
	st.throughput = stats.NewPeriodicSampler(time.Second, 60, func() stats.Sample {
		return &ThroughputSample{received: st.bytesReceived, served: st.bytesServed}
	})
}