pp "github.com/anacrolix/torrent/peer_protocol"
)
-// Various connection-level metrics. At the Torrent level these are
-// aggregates. Chunks are messages with data payloads. Data is actual torrent
-// content without any overhead. Useful is something we needed locally.
-// Unwanted is something we didn't ask for (but may still be useful). Written
-// is things sent to the peer, and Read is stuff received from them.
+// Various connection-level metrics. At the Torrent level these are aggregates. Chunks are messages
+// with data payloads. Data is actual torrent content without any overhead. Useful is something we
+// needed locally. Unwanted is something we didn't ask for (but may still be useful). Written is
+// things sent to the peer, and Read is stuff received from them. Due to the implementation of
+// Count, must be aligned on some platforms: See https://github.com/anacrolix/torrent/issues/262.
type ConnStats struct {
// Total bytes on the wire. Includes handshakes and encryption.
BytesWritten Count
}
}
+// The returned TorrentStats may require alignment in memory. See
+// https://github.com/anacrolix/torrent/issues/383.
func (t *Torrent) Stats() TorrentStats {
t.cl.rLock()
defer t.cl.rUnlock()
package torrent
+// Due to ConnStats, may require special alignment on some platforms. See
+// https://github.com/anacrolix/torrent/issues/383.
type TorrentStats struct {
- // Aggregates stats over all connections past and present. Some values may
- // not have much meaning in the aggregate context.
+ // Aggregates stats over all connections past and present. Some values may not have much meaning
+ // in the aggregate context.
ConnStats
// Ordered by expected descending quantities (if all is well).