RPC: add 'getnetstats' op, to return data on messages and peers #1510

pull jgarzik wants to merge 1 commits into bitcoin:master from jgarzik:stats changing 4 files +73 −0
  1. jgarzik commented at 1:40 AM on June 24, 2012: contributor

    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'.

  2. 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'.
    40c485aeb4
  3. jgarzik commented at 1:49 AM on June 24, 2012: contributor

    Sample output here: https://gist.github.com/2980975

  4. gavinandresen commented at 5:45 PM on June 25, 2012: contributor

    Design doesn't feel quite right to me.

    How about something like:

    getpeerinfo : returns list of peers (ip address, inbound/outbound, etc)

    getstat "which_stat_to_get" : generic RPC call for getting internal state of bitcoin...

  5. gmaxwell commented at 7:24 PM on June 25, 2012: contributor

    getstat "which_stat_to_get" would make it easier to wrap up in a snmp style poller, e.g. for graphing with an rrd tool frontend.

  6. jgarzik commented at 3:48 PM on June 27, 2012: contributor

    @gmaxwell all the kernel interfaces that SNMP uses tend to return groups of statistics that the kernel finds easy to generate together (tx pkts, rx pkts, rx bytes, tx bytes, collisions, ...) I see the same pattern elsewhere. So perhaps 'getstat $STAT' can return complex objects, if it is natural to do so internally.

    Regardless... closing. will work on 'getpeerinfo' and then see what's left.

  7. jgarzik closed this on Jun 27, 2012

  8. jgarzik deleted the branch on Aug 24, 2014
  9. suprnurd referenced this in commit ea793a71f1 on Dec 5, 2017
  10. lateminer referenced this in commit 5a4b0f9a70 on May 6, 2020
  11. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 00:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me