Remove separate postedKeepalives expvar
This commit is contained in:
parent
4ab20f60b6
commit
1080c837b9
|
@ -36,7 +36,6 @@ var (
|
|||
// Count of connections to peer with same client ID.
|
||||
connsToSelf = expvar.NewInt("connsToSelf")
|
||||
receivedKeepalives = expvar.NewInt("receivedKeepalives")
|
||||
postedKeepalives = expvar.NewInt("postedKeepalives")
|
||||
// Requests received for pieces we don't have.
|
||||
requestsReceivedForMissingPieces = expvar.NewInt("requestsReceivedForMissingPieces")
|
||||
requestedChunkLengths = expvar.NewMap("requestedChunkLengths")
|
||||
|
|
|
@ -680,7 +680,7 @@ func (cn *PeerConn) writer(keepAliveTimeout time.Duration) {
|
|||
}
|
||||
if cn.writeBuffer.Len() == 0 && time.Since(lastWrite) >= keepAliveTimeout && cn.useful() {
|
||||
cn.writeBuffer.Write(pp.Message{Keepalive: true}.MustMarshalBinary())
|
||||
postedKeepalives.Add(1)
|
||||
torrent.Add("written keepalives", 1)
|
||||
}
|
||||
if cn.writeBuffer.Len() == 0 {
|
||||
// TODO: Minimize wakeups....
|
||||
|
|
Loading…
Reference in New Issue