mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-30 06:31:20 +00:00
statistics.go fix
This commit is contained in:
parent
595587313c
commit
c8d5b4c43a
@ -67,9 +67,8 @@ func calculateStatistics(
|
||||
numBlocksPerSec[sec]++
|
||||
|
||||
// increase number of txs for that second
|
||||
// TODO: add tracking for tx/sec
|
||||
numTxsPerSec[sec] += 1
|
||||
logger.Debug(fmt.Sprintf("%d txs at block height %d", 1, blockMeta.Header.Height))
|
||||
numTxsPerSec[sec] += blockMeta.NumTxs
|
||||
logger.Debug(fmt.Sprintf("%d txs at block height %d", blockMeta.NumTxs, blockMeta.Header.Height))
|
||||
}
|
||||
|
||||
for i := int64(0); i < int64(duration); i++ {
|
||||
|
@ -2,8 +2,9 @@ package types
|
||||
|
||||
// BlockMeta contains meta information about a block - namely, it's ID and Header.
|
||||
type BlockMeta struct {
|
||||
BlockID BlockID `json:"block_id"` // the block hash and partsethash
|
||||
Header Header `json:"header"` // The block's Header
|
||||
BlockID BlockID `json:"block_id"` // the block hash and partsethash
|
||||
Header Header `json:"header"` // The block's Header
|
||||
NumTxs int64 `json:"number_txs"` //
|
||||
}
|
||||
|
||||
// NewBlockMeta returns a new BlockMeta from the block and its blockParts.
|
||||
@ -11,6 +12,7 @@ func NewBlockMeta(block *Block, blockParts *PartSet) *BlockMeta {
|
||||
return &BlockMeta{
|
||||
BlockID: BlockID{block.Hash(), blockParts.Header()},
|
||||
Header: block.Header,
|
||||
NumTxs: int64(len(block.Data.Txs)),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user