mirror of https://github.com/hak5/bolt.git
Only update rebalance time if nodes are rebalanced.
This commit changes TxStats.RebalanceTime to only update if there are nodes that have been rebalanced. Previously, the RebalanceTime would include a small amount of time to check if there were nodes to rebalance but this is confusing to users and not terribly helpful.master
parent
f873035fc9
commit
6e977e2f19
4
tx.go
4
tx.go
|
@ -141,7 +141,9 @@ func (tx *Tx) Commit() error {
|
|||
// Rebalance nodes which have had deletions.
|
||||
var startTime = time.Now()
|
||||
tx.root.rebalance()
|
||||
tx.stats.RebalanceTime += time.Since(startTime)
|
||||
if tx.stats.Rebalance > 0 {
|
||||
tx.stats.RebalanceTime += time.Since(startTime)
|
||||
}
|
||||
|
||||
// spill data onto dirty pages.
|
||||
startTime = time.Now()
|
||||
|
|
Loading…
Reference in New Issue