]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Merge branch 'master' into peer-requesting
authorMatt Joiner <anacrolix@gmail.com>
Mon, 20 Sep 2021 05:10:19 +0000 (15:10 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 20 Sep 2021 05:10:19 +0000 (15:10 +1000)
NOTES.md [new file with mode: 0644]
cmd/torrent/main.go

diff --git a/NOTES.md b/NOTES.md
new file mode 100644 (file)
index 0000000..37afb8c
--- /dev/null
+++ b/NOTES.md
@@ -0,0 +1,13 @@
+### Literature
+
+* [arvid on writing a fast piece picker](https://blog.libtorrent.org/2011/11/writing-a-fast-piece-picker/)
+
+    Uses C++ for examples.
+
+* [On Piece Selection for Streaming BitTorrent](https://www.diva-portal.org/smash/get/diva2:835742/FULLTEXT01.pdf)
+  Some simulations by some Swedes on piece selection.
+
+* [A South American paper on peer-selection strategies for uploading](https://arxiv.org/pdf/1402.2187.pdf)
+
+  Has some useful overviews of piece-selection.
index 624c2a4ee97b082e7cde31ba637f8dcca7256877..757ecdc75f2a75bea238211134a2ac17118bf685 100644 (file)
@@ -369,6 +369,15 @@ func downloadErr(flags downloadFlags) error {
                        <-stop.C()
                }
        }
+       spew.Dump(expvar.Get("torrent").(*expvar.Map).Get("chunks received"))
+       spew.Dump(client.ConnStats())
+       clStats := client.ConnStats()
+       sentOverhead := clStats.BytesWritten.Int64() - clStats.BytesWrittenData.Int64()
+       log.Printf(
+               "client read %v, %v was useful data. sent %v non-data bytes",
+               humanize.Bytes(uint64(clStats.BytesRead.Int64())),
+               100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()),
+               humanize.Bytes(uint64(sentOverhead)))
        return nil
 }