mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-24 09:40:32 +00:00
use milliseconds
This commit is contained in:
@@ -35,6 +35,7 @@ func (tn *TendermintNetwork) newBlockCallback(chainState *types.ChainState, val
|
||||
// implements eventmeter.EventLatencyFunc
|
||||
func (tn *TendermintNetwork) latencyCallback(chain *types.ChainState, val *types.ValidatorState) eventmeter.LatencyCallbackFunc {
|
||||
return func(latency float64) {
|
||||
latency = latency / 1000000.0 // ns to ms
|
||||
oldLatency := val.UpdateLatency(latency)
|
||||
chain.UpdateLatency(oldLatency, latency)
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ type BlockchainStatus struct {
|
||||
// Blockchain Info
|
||||
Height int `json:"height"`
|
||||
BlockchainSize int64 `json:"blockchain_size"`
|
||||
MeanBlockTime float64 `json:"mean_block_time" wire:"unsafe"`
|
||||
TxThroughput float64 `json:"tx_throughput" wire:"unsafe"`
|
||||
MeanBlockTime float64 `json:"mean_block_time" wire:"unsafe"` // ms
|
||||
TxThroughput float64 `json:"tx_throughput" wire:"unsafe"` // tx/s
|
||||
|
||||
blockTimeMeter metrics.Meter
|
||||
txThroughputMeter metrics.Meter
|
||||
@@ -93,7 +93,7 @@ type BlockchainStatus struct {
|
||||
NumValidators int `json:"num_validators"`
|
||||
ActiveValidators int `json:"active_validators"`
|
||||
ActiveNodes int `json:"active_nodes"`
|
||||
MeanLatency float64 `json:"mean_latency" wire:"unsafe"`
|
||||
MeanLatency float64 `json:"mean_latency" wire:"unsafe"` // ms
|
||||
Uptime float64 `json:"uptime" wire:"unsafe"`
|
||||
|
||||
// What else can we get / do we want?
|
||||
@@ -114,7 +114,7 @@ func (s *BlockchainStatus) NewBlock(block *tmtypes.Block) {
|
||||
s.Height = block.Header.Height
|
||||
s.blockTimeMeter.Mark(1)
|
||||
s.txThroughputMeter.Mark(int64(block.Header.NumTxs))
|
||||
s.MeanBlockTime = 1 / s.blockTimeMeter.RateMean()
|
||||
s.MeanBlockTime = (1 / s.blockTimeMeter.RateMean()) * 1000 // 1/s to ms
|
||||
s.TxThroughput = s.txThroughputMeter.RateMean()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user