ソースを参照

Remove unused receiver names.

Richard Crowley 12 年 前
コミット
296be4a47c
8 ファイル変更47 行追加47 行削除
  1. 4 4
      counter.go
  2. 3 3
      ewma.go
  3. 2 2
      gauge.go
  4. 4 4
      healthcheck.go
  5. 10 10
      histogram.go
  6. 6 6
      meter.go
  7. 4 4
      sample.go
  8. 14 14
      timer.go

+ 4 - 4
counter.go

@@ -43,16 +43,16 @@ func NewRegisteredCounter(name string, r Registry) Counter {
 type NilCounter struct{}
 
 // No-op.
-func (c NilCounter) Clear() {}
+func (NilCounter) Clear() {}
 
 // No-op.
-func (c NilCounter) Count() int64 { return 0 }
+func (NilCounter) Count() int64 { return 0 }
 
 // No-op.
-func (c NilCounter) Dec(i int64) {}
+func (NilCounter) Dec(i int64) {}
 
 // No-op.
-func (c NilCounter) Inc(i int64) {}
+func (NilCounter) Inc(i int64) {}
 
 // The standard implementation of a Counter uses the sync/atomic package
 // to manage a single int64 value.

+ 3 - 3
ewma.go

@@ -44,13 +44,13 @@ func NewEWMA15() EWMA {
 type NilEWMA struct{}
 
 // No-op.
-func (a NilEWMA) Rate() float64 { return 0.0 }
+func (NilEWMA) Rate() float64 { return 0.0 }
 
 // No-op.
-func (a NilEWMA) Tick() {}
+func (NilEWMA) Tick() {}
 
 // No-op.
-func (a NilEWMA) Update(n int64) {}
+func (NilEWMA) Update(n int64) {}
 
 // The standard implementation of an EWMA tracks the number of uncounted
 // events and processes them on each tick.  It uses the sync/atomic package

+ 2 - 2
gauge.go

@@ -41,10 +41,10 @@ func NewRegisteredGauge(name string, r Registry) Gauge {
 type NilGauge struct{}
 
 // No-op.
-func (g NilGauge) Update(v int64) {}
+func (NilGauge) Update(v int64) {}
 
 // No-op.
-func (g NilGauge) Value() int64 { return 0 }
+func (NilGauge) Value() int64 { return 0 }
 
 // The standard implementation of a Gauge uses the sync/atomic package
 // to manage a single int64 value.

+ 4 - 4
healthcheck.go

@@ -24,16 +24,16 @@ func NewHealthcheck(f func(Healthcheck)) Healthcheck {
 type NilHealthcheck struct{}
 
 // No-op.
-func (h NilHealthcheck) Check() {}
+func (NilHealthcheck) Check() {}
 
 // No-op.
-func (h NilHealthcheck) Error() error { return nil }
+func (NilHealthcheck) Error() error { return nil }
 
 // No-op.
-func (h NilHealthcheck) Healthy() {}
+func (NilHealthcheck) Healthy() {}
 
 // No-op.
-func (h NilHealthcheck) Unhealthy(err error) {}
+func (NilHealthcheck) Unhealthy(err error) {}
 
 // The standard implementation of a Healthcheck stores the status and a
 // function to call to update the status.

+ 10 - 10
histogram.go

@@ -61,36 +61,36 @@ func NewRegisteredHistogram(name string, r Registry, s Sample) Histogram {
 type NilHistogram struct{}
 
 // No-op.
-func (h NilHistogram) Clear() {}
+func (NilHistogram) Clear() {}
 
 // No-op.
-func (h NilHistogram) Count() int64 { return 0 }
+func (NilHistogram) Count() int64 { return 0 }
 
 // No-op.
-func (h NilHistogram) Max() int64 { return 0 }
+func (NilHistogram) Max() int64 { return 0 }
 
 // No-op.
-func (h NilHistogram) Mean() float64 { return 0.0 }
+func (NilHistogram) Mean() float64 { return 0.0 }
 
 // No-op.
-func (h NilHistogram) Min() int64 { return 0 }
+func (NilHistogram) Min() int64 { return 0 }
 
 // No-op.
-func (h NilHistogram) Percentile(p float64) float64 { return 0.0 }
+func (NilHistogram) Percentile(p float64) float64 { return 0.0 }
 
 // No-op.
-func (h NilHistogram) Percentiles(ps []float64) []float64 {
+func (NilHistogram) Percentiles(ps []float64) []float64 {
 	return make([]float64, len(ps))
 }
 
 // No-op.
-func (h NilHistogram) StdDev() float64 { return 0.0 }
+func (NilHistogram) StdDev() float64 { return 0.0 }
 
 // No-op.
-func (h NilHistogram) Update(v int64) {}
+func (NilHistogram) Update(v int64) {}
 
 // No-op.
-func (h NilHistogram) Variance() float64 { return 0.0 }
+func (NilHistogram) Variance() float64 { return 0.0 }
 
 // The standard implementation of a Histogram uses a Sample and a goroutine
 // to synchronize its calculations.

+ 6 - 6
meter.go

@@ -53,22 +53,22 @@ func NewRegisteredMeter(name string, r Registry) Meter {
 type NilMeter struct{}
 
 // No-op.
-func (m NilMeter) Count() int64 { return 0 }
+func (NilMeter) Count() int64 { return 0 }
 
 // No-op.
-func (m NilMeter) Mark(n int64) {}
+func (NilMeter) Mark(n int64) {}
 
 // No-op.
-func (m NilMeter) Rate1() float64 { return 0.0 }
+func (NilMeter) Rate1() float64 { return 0.0 }
 
 // No-op.
-func (m NilMeter) Rate5() float64 { return 0.0 }
+func (NilMeter) Rate5() float64 { return 0.0 }
 
 // No-op.
-func (m NilMeter) Rate15() float64 { return 0.0 }
+func (NilMeter) Rate15() float64 { return 0.0 }
 
 // No-op.
-func (m NilMeter) RateMean() float64 { return 0.0 }
+func (NilMeter) RateMean() float64 { return 0.0 }
 
 // The standard implementation of a Meter uses a goroutine to synchronize
 // its calculations and another goroutine (via time.Ticker) to produce

+ 4 - 4
sample.go

@@ -107,16 +107,16 @@ func (s *ExpDecaySample) Values() []int64 {
 type NilSample struct{}
 
 // No-op.
-func (s NilSample) Clear() {}
+func (NilSample) Clear() {}
 
 // No-op.
-func (s NilSample) Size() int { return 0 }
+func (NilSample) Size() int { return 0 }
 
 // No-op.
-func (s NilSample) Update(v int64) {}
+func (NilSample) Update(v int64) {}
 
 // No-op.
-func (s NilSample) Values() []int64 { return []int64{} }
+func (NilSample) Values() []int64 { return []int64{} }
 
 // A uniform sample using Vitter's Algorithm R.
 //

+ 14 - 14
timer.go

@@ -69,48 +69,48 @@ type NilTimer struct {
 }
 
 // No-op.
-func (t NilTimer) Count() int64 { return 0 }
+func (NilTimer) Count() int64 { return 0 }
 
 // No-op.
-func (t NilTimer) Max() int64 { return 0 }
+func (NilTimer) Max() int64 { return 0 }
 
 // No-op.
-func (t NilTimer) Mean() float64 { return 0.0 }
+func (NilTimer) Mean() float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) Min() int64 { return 0 }
+func (NilTimer) Min() int64 { return 0 }
 
 // No-op.
-func (t NilTimer) Percentile(p float64) float64 { return 0.0 }
+func (NilTimer) Percentile(p float64) float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) Percentiles(ps []float64) []float64 {
+func (NilTimer) Percentiles(ps []float64) []float64 {
 	return make([]float64, len(ps))
 }
 
 // No-op.
-func (t NilTimer) Rate1() float64 { return 0.0 }
+func (NilTimer) Rate1() float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) Rate5() float64 { return 0.0 }
+func (NilTimer) Rate5() float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) Rate15() float64 { return 0.0 }
+func (NilTimer) Rate15() float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) RateMean() float64 { return 0.0 }
+func (NilTimer) RateMean() float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) StdDev() float64 { return 0.0 }
+func (NilTimer) StdDev() float64 { return 0.0 }
 
 // No-op.
-func (t NilTimer) Time(f func()) {}
+func (NilTimer) Time(f func()) {}
 
 // No-op.
-func (t NilTimer) Update(d time.Duration) {}
+func (NilTimer) Update(d time.Duration) {}
 
 // No-op.
-func (t NilTimer) UpdateSince(ts time.Time) {}
+func (NilTimer) UpdateSince(ts time.Time) {}
 
 // The standard implementation of a Timer uses a Histogram and Meter directly.
 type StandardTimer struct {