croc/pkg/stats/bytes.go

18 lines
289 B
Go

package stats
// Bytes returns the stored number of bytes
func (s *Stats) Bytes() uint64 {
s.lock.RLock()
defer s.lock.RUnlock()
return s.nbBytes
}
// AddBytes increase the nbBytes counter
func (s *Stats) AddBytes(c uint64) {
s.lock.Lock()
defer s.lock.Unlock()
s.nbBytes += c
}