Преглед на файлове

Export more names for godoc's sake.

Richard Crowley преди 14 години
родител
ревизия
fa13d02e11
променени са 9 файла, в които са добавени 104 реда и са изтрити 101 реда
  1. 6 6
      counter.go
  2. 6 6
      ewma.go
  3. 4 4
      gauge.go
  4. 6 6
      healthcheck.go
  5. 13 13
      histogram.go
  6. 9 9
      meter.go
  7. 27 27
      registry.go
  8. 14 14
      sample.go
  9. 19 16
      timer.go

+ 6 - 6
counter.go

@@ -17,32 +17,32 @@ type Counter interface {
 // to manage a single int64 value.  When the latest weeklies land in a
 // release, atomic.LoadInt64 will be available and this code will become
 // safe on 32-bit architectures.
-type counter struct {
+type StandardCounter struct {
 	count int64
 }
 
 // Create a new counter.
 func NewCounter() Counter {
-	return &counter{0}
+	return &StandardCounter{0}
 }
 
 // Clear the counter: set it to zero.
-func (c *counter) Clear() {
+func (c *StandardCounter) Clear() {
 	c.count = 0
 }
 
 // Return the current count.  This is the method that's currently unsafe
 // on 32-bit architectures.
-func (c *counter) Count() int64 {
+func (c *StandardCounter) Count() int64 {
 	return c.count
 }
 
 // Decrement the counter by the given amount.
-func (c *counter) Dec(i int64) {
+func (c *StandardCounter) Dec(i int64) {
 	atomic.AddInt64(&c.count, -i)
 }
 
 // Increment the counter by the given amount.
-func (c *counter) Inc(i int64) {
+func (c *StandardCounter) Inc(i int64) {
 	atomic.AddInt64(&c.count, i)
 }

+ 6 - 6
ewma.go

@@ -21,7 +21,7 @@ type EWMA interface {
 // to manage uncounted events.  When the latest weeklies land in a release,
 // atomic.LoadInt64 will be available and this code will become safe on
 // 32-bit architectures.
-type ewma struct {
+type StandardEWMA struct {
 	alpha float64
 	uncounted int64
 	rate float64
@@ -32,7 +32,7 @@ type ewma struct {
 // Create a new EWMA with the given alpha.  Create the clock channel and
 // start the ticker goroutine.
 func NewEWMA(alpha float64) EWMA {
-	a := &ewma{alpha, 0, 0.0, false, make(chan bool)}
+	a := &StandardEWMA{alpha, 0, 0.0, false, make(chan bool)}
 	go a.ticker()
 	return a
 }
@@ -53,23 +53,23 @@ func NewEWMA15() EWMA {
 }
 
 // Return the moving average rate of events per second.
-func (a *ewma) Rate() float64 {
+func (a *StandardEWMA) Rate() float64 {
 	return a.rate * float64(1e9)
 }
 
 // Tick the clock to update the moving average.
-func (a *ewma) Tick() {
+func (a *StandardEWMA) Tick() {
 	a.tick <- true
 }
 
 // Add n uncounted events.
-func (a *ewma) Update(n int64) {
+func (a *StandardEWMA) Update(n int64) {
 	atomic.AddInt64(&a.uncounted, n)
 }
 
 // On each clock tick, update the moving average to reflect the number of
 // events seen since the last tick.
-func (a *ewma) ticker() {
+func (a *StandardEWMA) ticker() {
 	for <-a.tick {
 		count := a.uncounted
 		atomic.AddInt64(&a.uncounted, -count)

+ 4 - 4
gauge.go

@@ -15,21 +15,21 @@ type Gauge interface {
 // to manage a single int64 value.  When the latest weeklies land in a
 // release, atomic.LoadInt64 will be available and this code will become
 // safe on 32-bit architectures.
-type gauge struct {
+type StandardGauge struct {
 	value int64
 }
 
 // Create a new gauge.
 func NewGauge() Gauge {
-	return &gauge{0}
+	return &StandardGauge{0}
 }
 
 // Update the gauge's value.
-func (g *gauge) Update(v int64) {
+func (g *StandardGauge) Update(v int64) {
 	atomic.AddInt64(&g.value, v)
 }
 
 // Return the gauge's current value.
-func (g *gauge) Value() int64 {
+func (g *StandardGauge) Value() int64 {
 	return g.value
 }

+ 6 - 6
healthcheck.go

@@ -15,7 +15,7 @@ type Healthcheck interface {
 
 // The standard implementation of a Healthcheck stores the status and a
 // function to call to update the status.
-type healthcheck struct {
+type StandardHealthcheck struct {
 	err os.Error
 	f func(Healthcheck)
 }
@@ -23,25 +23,25 @@ type healthcheck struct {
 // Create a new healthcheck, which will use the given function to update
 // its status.
 func NewHealthcheck(f func(Healthcheck)) Healthcheck {
-	return &healthcheck{nil, f}
+	return &StandardHealthcheck{nil, f}
 }
 
 // Update the healthcheck's status.
-func (h *healthcheck) Check() {
+func (h *StandardHealthcheck) Check() {
 	h.f(h)
 }
 
 // Return the healthcheck's status, which will be nil if it is healthy.
-func (h *healthcheck) Error() os.Error {
+func (h *StandardHealthcheck) Error() os.Error {
 	return h.err
 }
 
 // Mark the healthcheck as healthy.
-func (h *healthcheck) Healthy() {
+func (h *StandardHealthcheck) Healthy() {
 	h.err = nil
 }
 
 // Mark the healthcheck as unhealthy.  The error should provide details.
-func (h *healthcheck) Unhealthy(err os.Error) {
+func (h *StandardHealthcheck) Unhealthy(err os.Error) {
 	h.err = err
 }

+ 13 - 13
histogram.go

@@ -24,7 +24,7 @@ type Histogram interface {
 
 // The standard implementation of a Histogram uses a Sample and a goroutine
 // to synchronize its calculations.
-type histogram struct {
+type StandardHistogram struct {
 	s Sample
 	in chan int64
 	out chan histogramV
@@ -41,7 +41,7 @@ type histogramV struct {
 // Create a new histogram with the given Sample.  Create the communication
 // channels and start the synchronizing goroutine.
 func NewHistogram(s Sample) Histogram {
-	h := &histogram{
+	h := &StandardHistogram{
 		s,
 		make(chan int64),
 		make(chan histogramV),
@@ -62,24 +62,24 @@ func newHistogramV() histogramV {
 }
 
 // Clear the histogram.
-func (h *histogram) Clear() {
+func (h *StandardHistogram) Clear() {
 	h.reset <- true
 }
 
 // Return the count of inputs since the histogram was last cleared.
-func (h *histogram) Count() int64 {
+func (h *StandardHistogram) Count() int64 {
 	return (<-h.out).count
 }
 
 // Return the maximal value seen since the histogram was last cleared.
-func (h *histogram) Max() int64 {
+func (h *StandardHistogram) Max() int64 {
 	hv := <-h.out
 	if 0 < hv.count { return hv.max }
 	return 0
 }
 
 // Return the mean of all values seen since the histogram was last cleared.
-func (h *histogram) Mean() float64 {
+func (h *StandardHistogram) Mean() float64 {
 	hv := <-h.out
 	if 0 < hv.count {
 		return float64(hv.sum) / float64(hv.count)
@@ -88,7 +88,7 @@ func (h *histogram) Mean() float64 {
 }
 
 // Return the minimal value seen since the histogram was last cleared.
-func (h *histogram) Min() int64 {
+func (h *StandardHistogram) Min() int64 {
 	hv := <-h.out
 	if 0 < hv.count { return hv.min }
 	return 0
@@ -96,13 +96,13 @@ func (h *histogram) Min() int64 {
 
 // Return an arbitrary percentile of all values seen since the histogram was
 // last cleared.
-func (h *histogram) Percentile(p float64) float64 {
+func (h *StandardHistogram) Percentile(p float64) float64 {
 	return h.Percentiles([]float64{p})[0]
 }
 
 // Return a slice of arbitrary percentiles of all values seen since the
 // histogram was last cleared.
-func (h *histogram) Percentiles(ps []float64) []float64 {
+func (h *StandardHistogram) Percentiles(ps []float64) []float64 {
 	scores := make([]float64, len(ps))
 	values := int64Slice(h.s.Values())
 	size := len(values)
@@ -126,17 +126,17 @@ func (h *histogram) Percentiles(ps []float64) []float64 {
 
 // Return the standard deviation of all values seen since the histogram was
 // last cleared.
-func (h *histogram) StdDev() float64 {
+func (h *StandardHistogram) StdDev() float64 {
 	return math.Sqrt(h.Variance())
 }
 
 // Update the histogram with a new value.
-func (h *histogram) Update(v int64) {
+func (h *StandardHistogram) Update(v int64) {
 	h.in <- v
 }
 
 // Return the variance of all values seen since the histogram was last cleared.
-func (h *histogram) Variance() float64 {
+func (h *StandardHistogram) Variance() float64 {
 	hv := <-h.out
 	if 1 >= hv.count { return 0.0 }
 	return hv.variance[1] / float64(hv.count - 1)
@@ -144,7 +144,7 @@ func (h *histogram) Variance() float64 {
 
 // Receive inputs and send outputs.  Sample each input and update values in
 // the histogramV.  Send a copy of the histogramV as output.
-func (h *histogram) arbiter() {
+func (h *StandardHistogram) arbiter() {
 	hv := newHistogramV()
 	for {
 		select {

+ 9 - 9
meter.go

@@ -19,7 +19,7 @@ type Meter interface {
 // The standard implementation of a Meter uses a goroutine to synchronize
 // its calculations and another goroutine (via time.Ticker) to produce
 // clock ticks.
-type meter struct {
+type StandardMeter struct {
 	in chan int64
 	out chan meterV
 	ticker *time.Ticker
@@ -35,7 +35,7 @@ type meterV struct {
 // Create a new meter.  Create the communication channels and start the
 // synchronizing goroutine.
 func NewMeter() Meter {
-	m := &meter{
+	m := &StandardMeter{
 		make(chan int64),
 		make(chan meterV),
 		time.NewTicker(5e9),
@@ -45,39 +45,39 @@ func NewMeter() Meter {
 }
 
 // Return the count of events seen.
-func (m *meter) Count() int64 {
+func (m *StandardMeter) Count() int64 {
 	return (<-m.out).count
 }
 
 // Mark the occurance of n events.
-func (m *meter) Mark(n int64) {
+func (m *StandardMeter) Mark(n int64) {
 	m.in <- n
 }
 
 // Return the meter's one-minute moving average rate of events.
-func (m *meter) Rate1() float64 {
+func (m *StandardMeter) Rate1() float64 {
 	return (<-m.out).rate1
 }
 
 // Return the meter's five-minute moving average rate of events.
-func (m *meter) Rate5() float64 {
+func (m *StandardMeter) Rate5() float64 {
 	return (<-m.out).rate5
 }
 
 // Return the meter's fifteen-minute moving average rate of events.
-func (m *meter) Rate15() float64 {
+func (m *StandardMeter) Rate15() float64 {
 	return (<-m.out).rate15
 }
 
 // Return the meter's mean rate of events.
-func (m *meter) RateMean() float64 {
+func (m *StandardMeter) RateMean() float64 {
 	return (<-m.out).rateMean
 }
 
 // Receive inputs and send outputs.  Count each input and update the various
 // moving averages and the mean rate of events.  Send a copy of the meterV
 // as output.
-func (m *meter) arbiter() {
+func (m *StandardMeter) arbiter() {
 	var mv meterV
 	a1 := NewEWMA1()
 	a5 := NewEWMA5()

+ 27 - 27
registry.go

@@ -43,7 +43,7 @@ type Registry interface {
 
 // The standard implementation of a Registry is a set of mutex-protected
 // maps of names to metrics.
-type registry struct {
+type StandardRegistry struct {
 	mutex *sync.Mutex
 	counters map[string]Counter
 	gauges map[string]Gauge
@@ -55,7 +55,7 @@ type registry struct {
 
 // Create a new registry.
 func NewRegistry() Registry {
-	return &registry {
+	return &StandardRegistry {
 		&sync.Mutex{},
 		make(map[string]Counter),
 		make(map[string]Gauge),
@@ -67,49 +67,49 @@ func NewRegistry() Registry {
 }
 
 // Call the given function for each registered counter.
-func (r *registry) EachCounter(f func(string, Counter)) {
+func (r *StandardRegistry) EachCounter(f func(string, Counter)) {
 	r.mutex.Lock()
 	for name, c := range r.counters { f(name, c) }
 	r.mutex.Unlock()
 }
 
 // Call the given function for each registered gauge.
-func (r *registry) EachGauge(f func(string, Gauge)) {
+func (r *StandardRegistry) EachGauge(f func(string, Gauge)) {
 	r.mutex.Lock()
 	for name, g := range r.gauges { f(name, g) }
 	r.mutex.Unlock()
 }
 
 // Call the given function for each registered healthcheck.
-func (r *registry) EachHealthcheck(f func(string, Healthcheck)) {
+func (r *StandardRegistry) EachHealthcheck(f func(string, Healthcheck)) {
 	r.mutex.Lock()
 	for name, h := range r.healthchecks { f(name, h) }
 	r.mutex.Unlock()
 }
 
 // Call the given function for each registered histogram.
-func (r *registry) EachHistogram(f func(string, Histogram)) {
+func (r *StandardRegistry) EachHistogram(f func(string, Histogram)) {
 	r.mutex.Lock()
 	for name, h := range r.histograms { f(name, h) }
 	r.mutex.Unlock()
 }
 
 // Call the given function for each registered meter.
-func (r *registry) EachMeter(f func(string, Meter)) {
+func (r *StandardRegistry) EachMeter(f func(string, Meter)) {
 	r.mutex.Lock()
 	for name, m := range r.meters { f(name, m) }
 	r.mutex.Unlock()
 }
 
 // Call the given function for each registered timer.
-func (r *registry) EachTimer(f func(string, Timer)) {
+func (r *StandardRegistry) EachTimer(f func(string, Timer)) {
 	r.mutex.Lock()
 	for name, t := range r.timers { f(name, t) }
 	r.mutex.Unlock()
 }
 
 // Get the Counter by the given name or nil if none is registered.
-func (r *registry) GetCounter(name string) Counter {
+func (r *StandardRegistry) GetCounter(name string) Counter {
 	r.mutex.Lock()
 	c := r.counters[name]
 	r.mutex.Unlock()
@@ -117,7 +117,7 @@ func (r *registry) GetCounter(name string) Counter {
 }
 
 // Get the Gauge by the given name or nil if none is registered.
-func (r *registry) GetGauge(name string) Gauge {
+func (r *StandardRegistry) GetGauge(name string) Gauge {
 	r.mutex.Lock()
 	g := r.gauges[name]
 	r.mutex.Unlock()
@@ -125,7 +125,7 @@ func (r *registry) GetGauge(name string) Gauge {
 }
 
 // Get the Healthcheck by the given name or nil if none is registered.
-func (r *registry) GetHealthcheck(name string) Healthcheck {
+func (r *StandardRegistry) GetHealthcheck(name string) Healthcheck {
 	r.mutex.Lock()
 	h := r.healthchecks[name]
 	r.mutex.Unlock()
@@ -133,7 +133,7 @@ func (r *registry) GetHealthcheck(name string) Healthcheck {
 }
 
 // Get the Histogram by the given name or nil if none is registered.
-func (r *registry) GetHistogram(name string) Histogram {
+func (r *StandardRegistry) GetHistogram(name string) Histogram {
 	r.mutex.Lock()
 	h := r.histograms[name]
 	r.mutex.Unlock()
@@ -141,7 +141,7 @@ func (r *registry) GetHistogram(name string) Histogram {
 }
 
 // Get the Meter by the given name or nil if none is registered.
-func (r *registry) GetMeter(name string) Meter {
+func (r *StandardRegistry) GetMeter(name string) Meter {
 	r.mutex.Lock()
 	m := r.meters[name]
 	r.mutex.Unlock()
@@ -149,7 +149,7 @@ func (r *registry) GetMeter(name string) Meter {
 }
 
 // Get the Timer by the given name or nil if none is registered.
-func (r *registry) GetTimer(name string) Timer {
+func (r *StandardRegistry) GetTimer(name string) Timer {
 	r.mutex.Lock()
 	t := r.timers[name]
 	r.mutex.Unlock()
@@ -157,91 +157,91 @@ func (r *registry) GetTimer(name string) Timer {
 }
 
 // Register the given Counter under the given name.
-func (r *registry) RegisterCounter(name string, c Counter) {
+func (r *StandardRegistry) RegisterCounter(name string, c Counter) {
 	r.mutex.Lock()
 	r.counters[name] = c
 	r.mutex.Unlock()
 }
 
 // Register the given Gauge under the given name.
-func (r *registry) RegisterGauge(name string, g Gauge) {
+func (r *StandardRegistry) RegisterGauge(name string, g Gauge) {
 	r.mutex.Lock()
 	r.gauges[name] = g
 	r.mutex.Unlock()
 }
 
 // Register the given Healthcheck under the given name.
-func (r *registry) RegisterHealthcheck(name string, h Healthcheck) {
+func (r *StandardRegistry) RegisterHealthcheck(name string, h Healthcheck) {
 	r.mutex.Lock()
 	r.healthchecks[name] = h
 	r.mutex.Unlock()
 }
 
 // Register the given Histogram under the given name.
-func (r *registry) RegisterHistogram(name string, h Histogram) {
+func (r *StandardRegistry) RegisterHistogram(name string, h Histogram) {
 	r.mutex.Lock()
 	r.histograms[name] = h
 	r.mutex.Unlock()
 }
 
 // Register the given Meter under the given name.
-func (r *registry) RegisterMeter(name string, m Meter) {
+func (r *StandardRegistry) RegisterMeter(name string, m Meter) {
 	r.mutex.Lock()
 	r.meters[name] = m
 	r.mutex.Unlock()
 }
 
 // Register the given Timer under the given name.
-func (r *registry) RegisterTimer(name string, t Timer) {
+func (r *StandardRegistry) RegisterTimer(name string, t Timer) {
 	r.mutex.Lock()
 	r.timers[name] = t
 	r.mutex.Unlock()
 }
 
 // Run all registered healthchecks.
-func (r *registry) RunHealthchecks() {
+func (r *StandardRegistry) RunHealthchecks() {
 	r.mutex.Lock()
 	for _, h := range r.healthchecks { h.Check() }
 	r.mutex.Unlock()
 }
 
 // Unregister the given Counter with the given name.
-func (r *registry) UnregisterCounter(name string) {
+func (r *StandardRegistry) UnregisterCounter(name string) {
 	r.mutex.Lock()
 	r.counters[name] = nil, false
 	r.mutex.Unlock()
 }
 
 // Unregister the given Gauge with the given name.
-func (r *registry) UnregisterGauge(name string) {
+func (r *StandardRegistry) UnregisterGauge(name string) {
 	r.mutex.Lock()
 	r.gauges[name] = nil, false
 	r.mutex.Unlock()
 }
 
 // Unregister the given Healthcheck with the given name.
-func (r *registry) UnregisterHealthcheck(name string) {
+func (r *StandardRegistry) UnregisterHealthcheck(name string) {
 	r.mutex.Lock()
 	r.healthchecks[name] = nil, false
 	r.mutex.Unlock()
 }
 
 // Unregister the given Histogram with the given name.
-func (r *registry) UnregisterHistogram(name string) {
+func (r *StandardRegistry) UnregisterHistogram(name string) {
 	r.mutex.Lock()
 	r.histograms[name] = nil, false
 	r.mutex.Unlock()
 }
 
 // Unregister the given Meter with the given name.
-func (r *registry) UnregisterMeter(name string) {
+func (r *StandardRegistry) UnregisterMeter(name string) {
 	r.mutex.Lock()
 	r.meters[name] = nil, false
 	r.mutex.Unlock()
 }
 
 // Unregister the given Timer with the given name.
-func (r *registry) UnregisterTimer(name string) {
+func (r *StandardRegistry) UnregisterTimer(name string) {
 	r.mutex.Lock()
 	r.timers[name] = nil, false
 	r.mutex.Unlock()

+ 14 - 14
sample.go

@@ -25,7 +25,7 @@ type Sample interface {
 // Model for Streaming Systems".
 //
 // <http://www.research.att.com/people/Cormode_Graham/library/publications/CormodeShkapenyukSrivastavaXu09.pdf>
-type expDecaySample struct {
+type ExpDecaySample struct {
 	reservoirSize int
 	alpha float64
 	in chan int64
@@ -36,7 +36,7 @@ type expDecaySample struct {
 // Create a new exponentially-decaying sample with the given reservoir size
 // and alpha.
 func NewExpDecaySample(reservoirSize int, alpha float64) Sample {
-	s := &expDecaySample{
+	s := &ExpDecaySample{
 		reservoirSize,
 		alpha,
 		make(chan int64),
@@ -48,29 +48,29 @@ func NewExpDecaySample(reservoirSize int, alpha float64) Sample {
 }
 
 // Clear all samples.
-func (s *expDecaySample) Clear() {
+func (s *ExpDecaySample) Clear() {
 	s.reset <- true
 }
 
 // Return the size of the sample, which is at most the reservoir size.
-func (s *expDecaySample) Size() int {
+func (s *ExpDecaySample) Size() int {
 	return len(<-s.out)
 }
 
 // Update the sample with a new value.
-func (s *expDecaySample) Update(v int64) {
+func (s *ExpDecaySample) Update(v int64) {
 	s.in <- v
 }
 
 // Return all the values in the sample.
-func (s *expDecaySample) Values() []int64 {
+func (s *ExpDecaySample) Values() []int64 {
 	return <-s.out
 }
 
 // Receive inputs and send outputs.  Count and save each input value,
 // rescaling the sample if enough time has elapsed since the last rescaling.
 // Send a copy of the values as output.
-func (s *expDecaySample) arbiter() {
+func (s *ExpDecaySample) arbiter() {
 	count := 0
 	values := make(map[float64]int64)
 	tsStart := time.Seconds()
@@ -124,7 +124,7 @@ func (s *expDecaySample) arbiter() {
 // A uniform sample using Vitter's Algorithm R.
 //
 // <http://www.cs.umd.edu/~samir/498/vitter.pdf>
-type uniformSample struct {
+type UniformSample struct {
 	reservoirSize int
 	in chan int64
 	out chan []int64
@@ -133,7 +133,7 @@ type uniformSample struct {
 
 // Create a new uniform sample with the given reservoir size.
 func NewUniformSample(reservoirSize int) Sample {
-	s := &uniformSample{
+	s := &UniformSample{
 		reservoirSize,
 		make(chan int64),
 		make(chan []int64),
@@ -144,28 +144,28 @@ func NewUniformSample(reservoirSize int) Sample {
 }
 
 // Clear all samples.
-func (s *uniformSample) Clear() {
+func (s *UniformSample) Clear() {
 	s.reset <- true
 }
 
 // Return the size of the sample, which is at most the reservoir size.
-func (s *uniformSample) Size() int {
+func (s *UniformSample) Size() int {
 	return len(<-s.out)
 }
 
 // Update the sample with a new value.
-func (s *uniformSample) Update(v int64) {
+func (s *UniformSample) Update(v int64) {
 	s.in <- v
 }
 
 // Return all the values in the sample.
-func (s *uniformSample) Values() []int64 {
+func (s *UniformSample) Values() []int64 {
 	return <-s.out
 }
 
 // Receive inputs and send outputs.  Count and save each input value at a
 // random index.  Send a copy of the values as output.
-func (s *uniformSample) arbiter() {
+func (s *UniformSample) arbiter() {
 	count := 0
 	values := make([]int64, s.reservoirSize)
 	var valuesCopy []int64

+ 19 - 16
timer.go

@@ -23,87 +23,90 @@ type Timer interface {
 }
 
 // The standard implementation of a Timer uses a Histogram and Meter directly.
-type timer struct {
+type StandardTimer struct {
 	h Histogram
 	m Meter
 }
 
 // Create a new timer with the given Histogram and Meter.
 func NewCustomTimer(h Histogram, m Meter) Timer {
-	return &timer{h, m}
+	return &StandardTimer{h, m}
 }
 
 // Create a new timer with a standard histogram and meter.  The histogram
 // will use an exponentially-decaying sample with the same reservoir size
 // and alpha as UNIX load averages.
 func NewTimer() Timer {
-	return &timer{NewHistogram(NewExpDecaySample(1028, 0.015)), NewMeter()}
+	return &StandardTimer{
+		NewHistogram(NewExpDecaySample(1028, 0.015)),
+		NewMeter(),
+	}
 }
 
 // Return the count of inputs.
-func (t *timer) Count() int64 {
+func (t *StandardTimer) Count() int64 {
 	return t.h.Count()
 }
 
 // Return the maximal value seen.
-func (t *timer) Max() int64 {
+func (t *StandardTimer) Max() int64 {
 	return t.h.Max()
 }
 
 // Return the mean of all values seen.
-func (t *timer) Mean() float64 {
+func (t *StandardTimer) Mean() float64 {
 	return t.h.Mean()
 }
 
 // Return the minimal value seen.
-func (t *timer) Min() int64 {
+func (t *StandardTimer) Min() int64 {
 	return t.h.Min()
 }
 
 // Return an arbitrary percentile of all values seen.
-func (t *timer) Percentile(p float64) float64 {
+func (t *StandardTimer) Percentile(p float64) float64 {
 	return t.h.Percentile(p)
 }
 
 // Return a slice of arbitrary percentiles of all values seen.
-func (t *timer) Percentiles(ps []float64) []float64 {
+func (t *StandardTimer) Percentiles(ps []float64) []float64 {
 	return t.h.Percentiles(ps)
 }
 
 // Return the meter's one-minute moving average rate of events.
-func (t *timer) Rate1() float64 {
+func (t *StandardTimer) Rate1() float64 {
 	return t.m.Rate1()
 }
 
 // Return the meter's five-minute moving average rate of events.
-func (t *timer) Rate5() float64 {
+func (t *StandardTimer) Rate5() float64 {
 	return t.m.Rate5()
 }
 
 // Return the meter's fifteen-minute moving average rate of events.
-func (t *timer) Rate15() float64 {
+func (t *StandardTimer) Rate15() float64 {
 	return t.m.Rate15()
 }
 
 // Return the meter's mean rate of events.
-func (t *timer) RateMean() float64 {
+func (t *StandardTimer) RateMean() float64 {
 	return t.m.RateMean()
 }
 
 // Return the standard deviation of all values seen.
-func (t *timer) StdDev() float64 {
+func (t *StandardTimer) StdDev() float64 {
 	return t.h.StdDev()
 }
 
 // Record the duration of the execution of the given function.
-func (t *timer) Time(f func()) {
+func (t *StandardTimer) Time(f func()) {
 	ts := time.Nanoseconds()
 	f()
 	t.Update(uint64(time.Nanoseconds() - ts))
 }
 
 // Record the duration of an event.
-func (t *timer) Update(duration uint64) {
+func (t *StandardTimer) Update(duration uint64) {
 	t.h.Update(int64(duration))
 	t.m.Mark(1)
 }