func (stats *Stats) Clear() {
	stats.durations = stats.durations[:0]
	stats.histogram = nil
	stats.dirty = false
}
Clear resets the stats, removing all values.
package stats
import (
	"bytes"
	"fmt"
	"io"
	"math"
	"time"
)
type Stats struct {
	numBuckets int
	unit       time.Duration
	min, max   int64
	histogram  *Histogram
	durations durationSlice
	dirty     bool
}
type durationSlice []time.Duration
func NewStats(numBuckets int) *Stats {
	if numBuckets <= 0 {
		numBuckets = 16
	}
	return &Stats{
		numBuckets: numBuckets + 1,
		durations:  make(durationSlice, 0, 100000),
	}
}
func (stats *Stats) Add(d time.Duration) {
	stats.durations = append(stats.durations, d)
	stats.dirty = true
}