yanic/respond/multi_collector.go
2016-03-12 00:02:39 +01:00

27 lines
587 B
Go

package respond
import "time"
//MultiCollector struct
type MultiCollector struct {
collectors []*Collector
}
//NewMultiCollector create a list of collectors
func NewMultiCollector(interval time.Duration, parseFunc ParseFunc) *MultiCollector {
return &MultiCollector{
collectors: []*Collector{
NewCollector("statistics", interval, parseFunc),
NewCollector("nodeinfo", interval, parseFunc),
NewCollector("neighbours", interval, parseFunc),
},
}
}
//Close all Collections
func (multi *MultiCollector) Close() {
for _, col := range multi.collectors {
col.Close()
}
}