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
Ben Johnson 2014-07-15 07:26:02 -06:00
parent f873035fc9
commit 6e977e2f19
1 changed files with 3 additions and 1 deletions

2
tx.go
View File

@ -141,7 +141,9 @@ func (tx *Tx) Commit() error {
// Rebalance nodes which have had deletions.
var startTime = time.Now()
tx.root.rebalance()
if tx.stats.Rebalance > 0 {
tx.stats.RebalanceTime += time.Since(startTime)
}
// spill data onto dirty pages.
startTime = time.Now()