1
0
Fork 0
shezmu/stats/group.go

28 lines
371 B
Go
Raw Normal View History

2015-10-24 01:22:02 +00:00
package stats
import (
"time"
)
type Group struct {
backends []Publisher
2015-10-24 01:22:02 +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)
}
}