Fix hashrate bug and add stats by algorithm to index and stats pages
This commit is contained in:
parent
795b93e254
commit
71024f18dc
|
@ -135,8 +135,7 @@ module.exports = function(logger, portalConfig, poolConfigs){
|
||||||
});
|
});
|
||||||
var shareMultiplier = algos[coinStats.algorithm].multiplier || 0;
|
var shareMultiplier = algos[coinStats.algorithm].multiplier || 0;
|
||||||
var hashratePre = shareMultiplier * coinStats.shares / portalConfig.website.hashrateWindow;
|
var hashratePre = shareMultiplier * coinStats.shares / portalConfig.website.hashrateWindow;
|
||||||
coinStats.hashrate = hashratePre / 1e3 | 0;
|
coinStats.hashrate = hashratePre | 0;
|
||||||
portalStats.global.hashrate += coinStats.hashrate;
|
|
||||||
portalStats.global.workers += Object.keys(coinStats.workers).length;
|
portalStats.global.workers += Object.keys(coinStats.workers).length;
|
||||||
|
|
||||||
/* algorithm specific global stats */
|
/* algorithm specific global stats */
|
||||||
|
|
|
@ -50,10 +50,12 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="stats">
|
{{ for(var algo in it.stats.algos) { }}
|
||||||
<div><i class="fa fa-users"></i> <span id="statsMiners">{{=it.stats.global.workers}}</span> Miners</div>
|
{{=algo}}: <div class="stats">
|
||||||
<div><i class="fa fa-tachometer"></i> <span id="statsHashrate">{{=it.stats.global.hashrate}}</span> KH/s</div>
|
<div><i class="fa fa-users"></i> <span id="statsMiners{{=algo}}">{{=it.stats.algos[algo].workers}}</span> Miners</div>
|
||||||
</div>
|
<div><i class="fa fa-tachometer"></i> <span id="statsHashrate{{=algo}}">{{=it.stats.algos[algo].hashrateString}}</span></div>
|
||||||
|
</div>
|
||||||
|
{{ } }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -1,5 +1,27 @@
|
||||||
<div>
|
<div>
|
||||||
fancy graphs here
|
<table class="pure-table">
|
||||||
<br>
|
<thead>
|
||||||
{{=JSON.stringify(it.stats)}}
|
<tr>
|
||||||
|
<th>Pool</th>
|
||||||
|
<th>Algo</th>
|
||||||
|
<th>Workers</th>
|
||||||
|
<th>Valid Shares</th>
|
||||||
|
<th>Invalid Shares</th>
|
||||||
|
<th>Blocks</th>
|
||||||
|
<th>Hashrate</th>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{{ for(var pool in it.stats.pools) { }}
|
||||||
|
<tr class="pure-table-odd">
|
||||||
|
<td>{{=it.stats.pools[pool].name}}</td>
|
||||||
|
<td>{{=it.stats.pools[pool].algorithm}}</td>
|
||||||
|
<td>{{=Object.keys(it.stats.pools[pool].workers).length}}</td>
|
||||||
|
<td>{{=it.stats.pools[pool].poolStats.validShares}}</td>
|
||||||
|
<td>{{=it.stats.pools[pool].poolStats.invalidShares}}</td>
|
||||||
|
<td>{{=it.stats.pools[pool].poolStats.validBlocks}}</td>
|
||||||
|
<td>{{=it.stats.pools[pool].hashrateString}}</div>
|
||||||
|
</tr>
|
||||||
|
{{ } }}
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue