From: Forrest Voight Date: Wed, 21 Mar 2012 18:20:28 +0000 (-0400) Subject: added peer count graph X-Git-Tag: 0.10.2~6 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=cbec6144c6b49457e315ec6dc5d92029a27b84cb added peer count graph --- diff --git a/p2pool/web.py b/p2pool/web.py index 959faf7..59c32d7 100644 --- a/p2pool/web.py +++ b/p2pool/web.py @@ -389,6 +389,8 @@ def get_web_root(tracker, current_work, current_work2, get_current_txouts, datad 'pool_rate': graph.DataStreamDescription(True, dataview_descriptions), 'pool_stale_rate': graph.DataStreamDescription(True, dataview_descriptions), 'current_payout': graph.DataStreamDescription(True, dataview_descriptions), + 'incoming_peers': graph.DataStreamDescription(True, dataview_descriptions), + 'outgoing_peers': graph.DataStreamDescription(True, dataview_descriptions), }, hd_obj) task.LoopingCall(lambda: _atomic_write(hd_path, json.dumps(hd.to_obj()))).start(100) @pseudoshare_received.watch @@ -406,6 +408,8 @@ def get_web_root(tracker, current_work, current_work2, get_current_txouts, datad hd.datastreams['pool_rate'].add_datum(t, poolrate) hd.datastreams['pool_stale_rate'].add_datum(t, poolrate - nonstalerate) hd.datastreams['current_payout'].add_datum(t, get_current_txouts().get(bitcoin_data.pubkey_hash_to_script2(my_pubkey_hash), 0)*1e-8) + hd.datastreams['incoming_peers'].add_datum(t, sum(1 for peer in p2p_node.peers.itervalues() if peer.incoming)) + hd.datastreams['outgoing_peers'].add_datum(t, sum(1 for peer in p2p_node.peers.itervalues() if not peer.incoming)) task.LoopingCall(add_point).start(5) new_root.putChild('graph_data', WebInterface(lambda source, view: json.dumps(hd.datastreams[source].dataviews[view].get_data(time.time())), 'application/json')) diff --git a/web-static/graphs.html b/web-static/graphs.html index 3526c93..fe8f548 100644 --- a/web-static/graphs.html +++ b/web-static/graphs.html @@ -49,6 +49,9 @@

Pool rate - Blue=All, Red=Stale (hash/second)

+

Peers - Blue=Incoming, Red=Outgoing

+ +