metrics: add chain error counter
This commit is contained in:
@ -5,9 +5,17 @@ type Chainer interface {
|
||||
}
|
||||
|
||||
type Chain struct {
|
||||
name string
|
||||
groups []*NodeGroup
|
||||
}
|
||||
|
||||
func NewChain(name string, groups ...*NodeGroup) *Chain {
|
||||
return &Chain{
|
||||
name: name,
|
||||
groups: groups,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Chain) AddNodeGroup(group *NodeGroup) {
|
||||
c.groups = append(c.groups, group)
|
||||
}
|
||||
@ -17,7 +25,9 @@ func (c *Chain) Route(network, address string) (r *Route) {
|
||||
return
|
||||
}
|
||||
|
||||
r = &Route{}
|
||||
r = &Route{
|
||||
chain: c,
|
||||
}
|
||||
for _, group := range c.groups {
|
||||
node := group.Next()
|
||||
if node == nil {
|
||||
|
Reference in New Issue
Block a user