]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Some changes to status output
authorMatt Joiner <anacrolix@gmail.com>
Thu, 1 Feb 2018 07:45:58 +0000 (18:45 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 1 Feb 2018 07:45:58 +0000 (18:45 +1100)
connection.go
torrent.go

index 0c0d7a9124843e2687593f30884ea67f23ead371..f53402b4030111ad801c0fa1d35f1e29c38015a9 100644 (file)
@@ -205,10 +205,10 @@ func (cn *connection) String() string {
 func (cn *connection) WriteStatus(w io.Writer, t *Torrent) {
        // \t isn't preserved in <pre> blocks?
        fmt.Fprintf(w, "%-40s: %s-%s\n", cn.PeerID, cn.localAddr(), cn.remoteAddr())
-       fmt.Fprintf(w, "    last msg: %s, connected: %s, last useful chunk: %s\n",
+       fmt.Fprintf(w, "    last msg: %s, connected: %s, last helpful: %s\n",
                eventAgeString(cn.lastMessageReceived),
                eventAgeString(cn.completedHandshake),
-               eventAgeString(cn.lastUsefulChunkReceived))
+               eventAgeString(cn.lastHelpful()))
        fmt.Fprintf(w,
                "    %s completed, %d pieces touched, good chunks: %d/%d-%d reqq: %d-%d, flags: %s\n",
                cn.completedString(),
index 0814dcee1f1649c4fb4ae661b769ce07248beafc..6a332e0e2920fc5ae04c2e651748a393ce2030b1 100644 (file)
@@ -557,7 +557,7 @@ func (t *Torrent) writeStatus(w io.Writer) {
                }
        }())
        if t.info != nil {
-               fmt.Fprintf(w, "Num Pieces: %d\n", t.numPieces())
+               fmt.Fprintf(w, "Num Pieces: %d (%d completed)\n", t.numPieces(), t.numPiecesCompleted())
                fmt.Fprint(w, "Piece States:")
                for _, psr := range t.pieceStateRuns() {
                        w.Write([]byte(" "))