]> Sergey Matveev's repositories - btrtrc.git/blobdiff - conn_stats.go
Track metadata chunks read with its own Count
[btrtrc.git] / conn_stats.go
index 2f1a50300ee92557342b212be54e2e8722f05b69..a691fb342f24bbe30fac479840097c8901e5dd5c 100644 (file)
@@ -29,6 +29,8 @@ type ConnStats struct {
        ChunksReadUseful Count
        ChunksReadWasted Count
 
+       MetadataChunksRead Count
+
        // Number of pieces data was written to, that subsequently passed verification.
        PiecesDirtiedGood Count
        // Number of pieces data was written to, that subsequently failed
@@ -73,6 +75,8 @@ func (cs *ConnStats) wroteMsg(msg *pp.Message) {
 }
 
 func (cs *ConnStats) readMsg(msg *pp.Message) {
+       // We want to also handle extended metadata pieces here, but we wouldn't
+       // have decoded the extended payload yet.
        switch msg.Type {
        case pp.Piece:
                cs.ChunksRead.Add(1)