connection.go | 6 +++--- global.go | 4 ---- diff --git a/connection.go b/connection.go index d6e2dcc3b333f52960e3ea2fd7df75ecc39a8764..f58ab28835474b9a26a6aea7d086d51ed98872f4 100644 --- a/connection.go +++ b/connection.go @@ -1204,7 +1204,7 @@ // Handle a received chunk from a peer. func (c *connection) receiveChunk(msg *pp.Message) { t := c.t cl := t.cl - chunksReceived.Add(1) + torrent.Add("chunks received", 1) req := newRequestFromMessage(msg) @@ -1212,7 +1212,7 @@ // Request has been satisfied. if c.deleteRequest(req) { c.updateRequests() } else { - unexpectedChunksReceived.Add(1) + torrent.Add("chunks received unexpected", 1) } if c.PeerChoked { @@ -1224,7 +1224,7 @@ } // Do we actually want this chunk? if !t.wantPiece(req) { - unwantedChunksReceived.Add(1) + torrent.Add("chunks received unwanted", 1) c.allStats(add(1, func(cs *ConnStats) *Count { return &cs.ChunksReadUnwanted })) return } diff --git a/global.go b/global.go index 5875fd149700ce35e2e06652e57ab75e57ee8bd4..43b84ee192c2b00678bbdfedec2b9e5b05acada4 100644 --- a/global.go +++ b/global.go @@ -23,10 +23,6 @@ // I could move a lot of these counters to their own file, but I suspect they // may be attached to a Client someday. var ( - unwantedChunksReceived = expvar.NewInt("chunksReceivedUnwanted") - unexpectedChunksReceived = expvar.NewInt("chunksReceivedUnexpected") - chunksReceived = expvar.NewInt("chunksReceived") - torrent = expvar.NewMap("torrent") peersAddedBySource = expvar.NewMap("peersAddedBySource")