2015-10-24 01:22:02 +00:00
|
|
|
package stats
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Group struct {
|
2015-10-26 23:54:00 +00:00
|
|
|
backends []Publisher
|
2015-10-24 01:22:02 +00:00
|
|
|
}
|
|
|
|
|
2015-10-26 23:54:00 +00:00
|
|
|
func NewGroup(backends ...Publisher) *Group {
|
2015-10-24 01:22:02 +00:00
|
|
|
return &Group{
|
|
|
|
backends: backends,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) Add(name string, dur time.Duration) {
|
|
|
|
for _, b := range g.backends {
|
|
|
|
b.Add(name, dur)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Group) Error(name string) {
|
|
|
|
for _, b := range g.backends {
|
|
|
|
b.Error(name)
|
|
|
|
}
|
|
|
|
}
|