I might want to add "average time to share" per-worker sometime soon on my nodes.
I tried to produce a diff. Actually it's only a few lines added to work.py and web.py. You get some additional data in ..../local_stats and ..../global_stats by that. You will have to integrate that with your web frontend, of course. Or I'd forward my index.html if you send me your mail address.
diff -ru p2pool-rav/p2pool/web.py /usr/local/p2pool.smc/p2pool/web.py
--- p2pool-rav/p2pool/web.py 2014-02-12 16:35:17.519474099 +0100
+++ /usr/local/p2pool.smc/p2pool/web.py 2014-02-11 19:57:17.917758829 +0100
@@ -99,11 +99,15 @@
nonstale_hash_rate = p2pool_data.get_pool_attempts_per_second(node.tracker, node.best_share_var.value, lookbehind)
stale_prop = p2pool_data.get_average_stale_prop(node.tracker, node.best_share_var.value, lookbehind)
+ diff = bitcoin_data.target_to_difficulty(wb.current_work.value['bits'].target)
+
return dict(
pool_nonstale_hash_rate=nonstale_hash_rate,
pool_hash_rate=nonstale_hash_rate/(1 - stale_prop),
pool_stale_prop=stale_prop,
min_difficulty=bitcoin_data.target_to_difficulty(node.tracker.items[node.best_share_var.value].max_target),
+ network_block_difficulty=diff,
+ network_hashrate=(diff * 2**32 // node.net.PARENT.BLOCK_PERIOD),
)
def get_local_stats():
@@ -130,6 +134,10 @@
miner_hash_rates, miner_dead_hash_rates = wb.get_local_rates()
(stale_orphan_shares, stale_doa_shares), shares, _ = wb.get_stale_counts()
+
+ miner_last_difficulties = {}
+ for addr in wb.last_work_shares.value:
+ miner_last_difficulties[addr] = bitcoin_data.target_to_difficulty(wb.last_work_shares.value[addr].target)
return dict(
my_hash_rates_in_last_hour=dict(
@@ -152,6 +160,7 @@
),
miner_hash_rates=miner_hash_rates,
miner_dead_hash_rates=miner_dead_hash_rates,
+ miner_last_difficulties=miner_last_difficulties,
efficiency_if_miner_perfect=(1 - stale_orphan_shares/shares)/(1 - global_stale_prop) if shares else None, # ignores dead shares because those are miner's fault and indicated by pseudoshare rejection
efficiency=(1 - (stale_orphan_shares+stale_doa_shares)/shares)/(1 - global_stale_prop) if shares else None,
peers=dict(
diff -ru p2pool-rav/p2pool/work.py /usr/local/p2pool.smc/p2pool/work.py
--- p2pool-rav/p2pool/work.py 2014-02-12 16:35:17.519474099 +0100
+++ /usr/local/p2pool.smc/p2pool/work.py 2014-02-11 19:44:08.277761641 +0100
@@ -36,6 +38,7 @@
self.removed_unstales_var = variable.Variable((0, 0, 0))
self.removed_doa_unstales_var = variable.Variable(0)
+ self.last_work_shares = variable.Variable( {} )
self.my_share_hashes = set()
self.my_doa_share_hashes = set()
@@ -319,6 +322,12 @@
self.current_work.value['subsidy']*1e-8, self.node.net.PARENT.SYMBOL,
len(self.current_work.value['transactions']),
)
+ #need this for stats
+ self.last_work_shares.value[bitcoin_data.pubkey_hash_to_address(pubkey_hash, self.node.net.PARENT)]=share_info['bits']
ba = dict(
version=min(self.current_work.value['version'], 2),
Question: Could somebody point me to a tutorial or so on how to get this merged into the p2pool-rav repo with a proper merge request? Never done that