diff --git a/libs/stats.js b/libs/stats.js index 5c31ccb..05be656 100644 --- a/libs/stats.js +++ b/libs/stats.js @@ -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 */ diff --git a/website/index.html b/website/index.html index 35ac208..e68fdb4 100644 --- a/website/index.html +++ b/website/index.html @@ -50,10 +50,12 @@ -
-
 {{=it.stats.global.workers}} Miners
-
 {{=it.stats.global.hashrate}} KH/s
-
+ {{ for(var algo in it.stats.algos) { }} + {{=algo}}:
+
 {{=it.stats.algos[algo].workers}} Miners
+
 {{=it.stats.algos[algo].hashrateString}}
+
  + {{ } }} @@ -86,4 +88,4 @@ - \ No newline at end of file + diff --git a/website/pages/stats.html b/website/pages/stats.html index ccab08e..7a71d0e 100644 --- a/website/pages/stats.html +++ b/website/pages/stats.html @@ -1,5 +1,27 @@
- fancy graphs here -
- {{=JSON.stringify(it.stats)}} -
\ No newline at end of file + + + + + + + + + + + + + + {{ for(var pool in it.stats.pools) { }} + + + + + + + + + {{ } }} +
PoolAlgoWorkersValid SharesInvalid SharesBlocksHashrate
{{=it.stats.pools[pool].name}}{{=it.stats.pools[pool].algorithm}}{{=Object.keys(it.stats.pools[pool].workers).length}}{{=it.stats.pools[pool].poolStats.validShares}}{{=it.stats.pools[pool].poolStats.invalidShares}}{{=it.stats.pools[pool].poolStats.validBlocks}}{{=it.stats.pools[pool].hashrateString}} +
+ diff --git a/website/static/main.js b/website/static/main.js index a87d63e..6c94769 100644 --- a/website/static/main.js +++ b/website/static/main.js @@ -1,6 +1,5 @@ $(function(){ - var hotSwap = function(page, pushSate){ if (pushSate) history.pushState(null, null, '/' + page); $('.selected').removeClass('selected'); @@ -29,8 +28,10 @@ $(function(){ var statsSource = new EventSource("/api/live_stats"); statsSource.addEventListener('message', function(e){ var stats = JSON.parse(e.data); - $('#statsMiners').text(stats.global.workers); - $('#statsHashrate').text(stats.global.hashrate); + for (algo in algos) { + $('#statsMiners'+algo).text(stats.algos[algo].workers); + $('#statsHashrate'+algo).text(stats.algos[algo].hashrateString); + } }); -}); \ No newline at end of file +});