Update the peersAddedBySource expvar
This commit is contained in:
parent
d4430e89b6
commit
5f47e808fb
|
@ -29,8 +29,6 @@ func defaultPeerExtensionBytes() PeerExtensionBits {
|
||||||
var (
|
var (
|
||||||
torrent = expvar.NewMap("torrent")
|
torrent = expvar.NewMap("torrent")
|
||||||
|
|
||||||
peersAddedBySource = expvar.NewMap("peersAddedBySource")
|
|
||||||
|
|
||||||
pieceHashedCorrect = expvar.NewInt("pieceHashedCorrect")
|
pieceHashedCorrect = expvar.NewInt("pieceHashedCorrect")
|
||||||
pieceHashedNotCorrect = expvar.NewInt("pieceHashedNotCorrect")
|
pieceHashedNotCorrect = expvar.NewInt("pieceHashedNotCorrect")
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ func (t *Torrent) unclosedConnsAsSlice() (ret []*PeerConn) {
|
||||||
|
|
||||||
func (t *Torrent) addPeer(p Peer) {
|
func (t *Torrent) addPeer(p Peer) {
|
||||||
cl := t.cl
|
cl := t.cl
|
||||||
peersAddedBySource.Add(string(p.Source), 1)
|
torrent.Add(fmt.Sprintf("peers added by source %q", p.Source), 1)
|
||||||
if t.closed.IsSet() {
|
if t.closed.IsSet() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue