add gas limit chart

This commit is contained in:
Fabian Vogelsteller
2015-08-06 12:22:47 +02:00
parent c4f8343372
commit c1f1a0989d
3 changed files with 46 additions and 0 deletions

View File

@@ -436,6 +436,25 @@ History.prototype.getBlockTimes = function()
return blockTimes;
}
History.prototype.getGasLimit = function()
{
var gasLimitHistory = _( this._items )
.sortByOrder( 'height', false )
.filter(function (item)
{
return item.block.trusted;
})
.slice(0, MAX_BINS)
.reverse()
.map(function (item)
{
return item.block.gasLimit;
})
.value();
return gasLimitHistory;
}
History.prototype.getDifficulty = function()
{
var difficultyHistory = _( this._items )
@@ -570,6 +589,7 @@ History.prototype.getCharts = function()
uncles: item.block.uncles.length,
transactions: item.block.transactions.length,
gasSpending: item.block.gasUsed,
gasLimit: item.block.gasLimit,
miner: item.block.miner
};
})
@@ -583,6 +603,7 @@ History.prototype.getCharts = function()
uncles : _.pluck( chartHistory, 'uncles' ),
transactions : _.pluck( chartHistory, 'transactions' ),
gasSpending : _.pluck( chartHistory, 'gasSpending' ),
gasLimit : _.pluck( chartHistory, 'gasLimit' ),
miners : this.getMinersCount(),
propagation : this.getBlockPropagation(),
uncleCount : this.getUncleCount(),