added blocktime average to history
This commit is contained in:
parent
e9618aac5c
commit
4f7ba9f578
@ -295,6 +295,7 @@ History.prototype.getCharts = function()
|
|||||||
var chart = {
|
var chart = {
|
||||||
height: _.pluck(chartHistory, 'height'),
|
height: _.pluck(chartHistory, 'height'),
|
||||||
blocktime: _.pluck(chartHistory, 'blocktime'),
|
blocktime: _.pluck(chartHistory, 'blocktime'),
|
||||||
|
avgBlocktime: _.sum(_.pluck(chartHistory, 'blocktime')) / (chartHistory.length === 0 ? 1 : chartHistory.length),
|
||||||
difficulty: _.pluck(chartHistory, 'difficulty'),
|
difficulty: _.pluck(chartHistory, 'difficulty'),
|
||||||
uncles: _.pluck(chartHistory, 'uncles'),
|
uncles: _.pluck(chartHistory, 'uncles'),
|
||||||
transactions: _.pluck(chartHistory, 'transactions'),
|
transactions: _.pluck(chartHistory, 'transactions'),
|
||||||
|
@ -153,6 +153,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
|
|
||||||
case "charts":
|
case "charts":
|
||||||
$scope.lastBlocksTime = data.blocktime;
|
$scope.lastBlocksTime = data.blocktime;
|
||||||
|
$scope.avgBlockTime = data.avgBlocktime;
|
||||||
$scope.difficultyChart = data.difficulty;
|
$scope.difficultyChart = data.difficulty;
|
||||||
$scope.transactionDensity = data.transactions;
|
$scope.transactionDensity = data.transactions;
|
||||||
$scope.gasSpending = data.gasSpending;
|
$scope.gasSpending = data.gasSpending;
|
||||||
@ -279,10 +280,6 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.avgBlockTime = _.max($scope.nodes, function(node) {
|
|
||||||
return parseInt(node.stats.block.number);
|
|
||||||
}).stats.blocktimeAvg;
|
|
||||||
|
|
||||||
$scope.upTimeTotal = _.reduce($scope.nodes, function(total, node) {
|
$scope.upTimeTotal = _.reduce($scope.nodes, function(total, node) {
|
||||||
return total + node.stats.uptime;
|
return total + node.stats.uptime;
|
||||||
}, 0) / $scope.nodes.length;
|
}, 0) / $scope.nodes.length;
|
||||||
|
Loading…
Reference in New Issue
Block a user