aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tx.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/tx.go b/tx.go
index 759913d..e225362 100644
--- a/tx.go
+++ b/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()