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 hashratePre = shareMultiplier * coinStats.shares / portalConfig.website.hashrateWindow;
|
||||
coinStats.hashrate = hashratePre / 1e3 | 0;
|
||||
portalStats.global.hashrate += coinStats.hashrate;
|
||||
coinStats.hashrate = hashratePre | 0;
|
||||
portalStats.global.workers += Object.keys(coinStats.workers).length;
|
||||
|
||||
/* algorithm specific global stats */
|
||||
|
|
|
@ -50,10 +50,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="stats">
|
||||
<div><i class="fa fa-users"></i> <span id="statsMiners">{{=it.stats.global.workers}}</span> Miners</div>
|
||||
<div><i class="fa fa-tachometer"></i> <span id="statsHashrate">{{=it.stats.global.hashrate}}</span> KH/s</div>
|
||||
</div>
|
||||
{{ for(var algo in it.stats.algos) { }}
|
||||
{{=algo}}: <div class="stats">
|
||||
<div><i class="fa fa-users"></i> <span id="statsMiners{{=algo}}">{{=it.stats.algos[algo].workers}}</span> Miners</div>
|
||||
<div><i class="fa fa-tachometer"></i> <span id="statsHashrate{{=algo}}">{{=it.stats.algos[algo].hashrateString}}</span></div>
|
||||
</div>
|
||||
{{ } }}
|
||||
|
||||
</div>
|
||||
</header>
|
||||
|
@ -86,4 +88,4 @@
|
|||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -1,5 +1,27 @@
|
|||
<div>
|
||||
fancy graphs here
|
||||
<br>
|
||||
{{=JSON.stringify(it.stats)}}
|
||||
</div>
|
||||
<table class="pure-table">
|
||||
<thead>
|
||||
<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>
|
||||
|
|
Loading…
Reference in New Issue