From acc4880dd695c1b73701fecf86d846bac0639094 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 13 Jun 2013 16:25:52 +0200 Subject: [PATCH] Adding block luck graph * Added expected vs actual share graph to block stats * Added new small table template for overall stats in pool stats Fixes #91 --- .../include/pages/statistics/blocks.inc.php | 2 +- .../mmcFE/statistics/blocks/default.tpl | 70 +++++++++++++++++++ .../{blocks_found.tpl => small_table.tpl} | 13 +--- .../mmcFE/statistics/pool/authenticated.tpl | 2 +- 4 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 public/templates/mmcFE/statistics/blocks/default.tpl rename public/templates/mmcFE/statistics/blocks/{blocks_found.tpl => small_table.tpl} (62%) diff --git a/public/include/pages/statistics/blocks.inc.php b/public/include/pages/statistics/blocks.inc.php index 69bbade7..e83aa8a8 100644 --- a/public/include/pages/statistics/blocks.inc.php +++ b/public/include/pages/statistics/blocks.inc.php @@ -13,5 +13,5 @@ $aBlockData = $aBlocksFoundData[0]; $smarty->assign("BLOCKSFOUND", $aBlocksFoundData); $smarty->assign("BLOCKLIMIT", $iLimit); -$smarty->assign("CONTENT", "blocks_found.tpl"); +$smarty->assign("CONTENT", "default.tpl"); ?> diff --git a/public/templates/mmcFE/statistics/blocks/default.tpl b/public/templates/mmcFE/statistics/blocks/default.tpl new file mode 100644 index 00000000..1511a46b --- /dev/null +++ b/public/templates/mmcFE/statistics/blocks/default.tpl @@ -0,0 +1,70 @@ +{include file="global/block_header.tpl" BLOCK_HEADER="Block Luck" BLOCK_STYLE="clear:none;"} + + + +{section block $BLOCKSFOUND} + +{/section} + + + + + +{section block $BLOCKSFOUND} + +{/section} + + + +{section block $BLOCKSFOUND} + +{/section} + + +
{$BLOCKSFOUND[block].height}
Expected Shares{(pow(2,32 - $GLOBAL.config.targetdiff) * $BLOCKSFOUND[block].difficulty)}
Actual Shares{$BLOCKSFOUND[block].shares}
+

+

+The graph above illustrates N shares to find a block vs. E Shares expected to find a block based on +target and network difficulty and assuming a zero variance scenario. +

+{include file="global/block_footer.tpl"} + +{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"} +
+ + + + + + + + + + + + + +{assign var=rank value=1} +{section block $BLOCKSFOUND} + + + + + + + + + +{/section} + +
BlockValidityFinderTimeDifficultyExpected SharesActual Shares
{$BLOCKSFOUND[block].height} + {if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations} + Confirmed + {else if $BLOCKSFOUND[block].confirmations == -1} + Orphan + {else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}{$BLOCKSFOUND[block].finder|default:"unknown"}{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}{$BLOCKSFOUND[block].difficulty|number_format:"2"}{(pow(2,32 - $GLOBAL.config.targetdiff) * $BLOCKSFOUND[block].difficulty)|number_format}{$BLOCKSFOUND[block].shares|number_format}
+
+ +{include file="global/block_footer.tpl"} diff --git a/public/templates/mmcFE/statistics/blocks/blocks_found.tpl b/public/templates/mmcFE/statistics/blocks/small_table.tpl similarity index 62% rename from public/templates/mmcFE/statistics/blocks/blocks_found.tpl rename to public/templates/mmcFE/statistics/blocks/small_table.tpl index d66e1349..9152fcc7 100644 --- a/public/templates/mmcFE/statistics/blocks/blocks_found.tpl +++ b/public/templates/mmcFE/statistics/blocks/small_table.tpl @@ -1,14 +1,12 @@ {include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
- +
- - - + @@ -16,15 +14,8 @@ {section block $BLOCKSFOUND} - - {/section} diff --git a/public/templates/mmcFE/statistics/pool/authenticated.tpl b/public/templates/mmcFE/statistics/pool/authenticated.tpl index bedd8d4b..5c67bbcd 100644 --- a/public/templates/mmcFE/statistics/pool/authenticated.tpl +++ b/public/templates/mmcFE/statistics/pool/authenticated.tpl @@ -44,6 +44,6 @@ {include file="global/block_footer.tpl"} -{include file="statistics/blocks/blocks_found.tpl" ALIGN="right"} +{include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true} {include file="global/block_footer.tpl"}
BlockValidity Finder TimeDifficultySharesActual Shares
{$BLOCKSFOUND[block].height} - {if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations} - Confirmed - {else if $BLOCKSFOUND[block].confirmations == -1} - Orphan - {else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if} {$BLOCKSFOUND[block].finder|default:"unknown"} {$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}{$BLOCKSFOUND[block].difficulty|number_format:"2"} {$BLOCKSFOUND[block].shares|number_format}