Skip to content

Commit 7cdbcea

Browse files
author
Codex
committed
fix(metrics): add AliveCount method to AliveDialerSet
1 parent 55ab624 commit 7cdbcea

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

component/outbound/dialer/alive_dialer_set.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ func (a *AliveDialerSet) GetRand() *Dialer {
102102
return a.inorderedAliveDialerSet[ind]
103103
}
104104

105+
func (a *AliveDialerSet) AliveCount() int {
106+
a.mu.Lock()
107+
defer a.mu.Unlock()
108+
return len(a.inorderedAliveDialerSet)
109+
}
110+
105111
func (a *AliveDialerSet) SortingLatency(d *Dialer) time.Duration {
106112
return a.dialerToLatency[d] + a.dialerToLatencyOffset[d]
107113
}

0 commit comments

Comments
 (0)