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