client.go | 10 ++++++++-- diff --git a/client.go b/client.go index 7ae72295da5f38e8c20fd7ee681b46314f984b8a..682cf8361850012b50118f49098765e71db57b26 100644 --- a/client.go +++ b/client.go @@ -47,8 +47,8 @@ // Clients contain zero or more Torrents. A Client manages a blocklist, the // TCP/UDP protocol ports, and DHT as desired. type Client struct { - // An aggregate of stats over all connections. First in struct to ensure - // 64-bit alignment of fields. See #262. + // An aggregate of stats over all connections. First in struct to ensure 64-bit alignment of + // fields. See #262. stats ConnStats _mu lockWithDeferreds @@ -1516,3 +1516,9 @@ func (cl *Client) String() string { return fmt.Sprintf("<%[1]T %[1]p>", cl) } + +// Returns connection-level aggregate stats at the Client level. See the comment on +// TorrentStats.ConnStats. +func (cl *Client) ConnStats() ConnStats { + return cl.stats.Copy() +}