浏览代码

Merge branch 'master' of git://github.com/AlekSi/go-metrics

Richard Crowley 12 年之前
父节点
当前提交
f1df2bb021
共有 2 个文件被更改,包括 13 次插入1 次删除
  1. 12 0
      registry.go
  2. 1 1
      timer.go

+ 12 - 0
registry.go

@@ -8,10 +8,19 @@ import "sync"
 // This is an interface so as to encourage other structs to implement
 // the Registry API as appropriate.
 type Registry interface {
+	// Call the given function for each registered metric.
 	Each(func(string, interface{}))
+
+	// Get the metric by the given name or nil if none is registered.
 	Get(string) interface{}
+
+	// Register the given metric under the given name.
 	Register(string, interface{})
+
+	// Run all registered healthchecks.
 	RunHealthchecks()
+
+	// Unregister the metric with the given name.
 	Unregister(string)
 }
 
@@ -22,6 +31,9 @@ type StandardRegistry struct {
 	metrics map[string]interface{}
 }
 
+// Check interface.
+var _ Registry = &StandardRegistry{}
+
 // Create a new registry.
 func NewRegistry() *StandardRegistry {
 	return &StandardRegistry{

+ 1 - 1
timer.go

@@ -5,7 +5,7 @@ import "time"
 // Timers capture the duration and rate of events.
 //
 // This is an interface so as to encourage other structs to implement
-// the Histogram API as appropriate.
+// the Timer API as appropriate.
 type Timer interface {
 	Count() int64
 	Max() int64