shezmu/stats/group.go

30 lines
424 B
Go
Raw Normal View History

2015-10-24 04:22:02 +03:00
package stats
import (
"time"
"github.com/localhots/satan"
)
type Group struct {
2015-10-24 18:17:24 +03:00
backends []satan.StatsPublisher
2015-10-24 04:22:02 +03:00
}
2015-10-24 18:17:24 +03:00
func NewGroup(backends ...satan.StatsPublisher) *Group {
2015-10-24 04:22:02 +03: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)
}
}