bitcoin/bitcoin — pull request #1510 by jgarzik (2012-06-24 01:40:10+00:00)
Title: RPC: add 'getnetstats' op, to return data on messages and peers

The returned data is

1. Per-message arrays.

Index 0 is total number of $ThisType messages
received since program start (or uint64 counter wrap).

Index 1 is total byte count since program start (or uint64
counter wrap).

They are returned as strings due to unfortunate JSON implementations
in the field that do not handle unquoted uint64 numbers correctly.

2. Peer information. Returns number of inbound, outbound and total peers.
Total peer count is equivalent to RPC 'getconnectioncount'.