aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-07-15 07:29:10 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-07-15 07:29:10 -0600
commit1395a04d97d598ad435d89c5ef1734956b2c9f00 (patch)
treea0d4c3dd4428bc77ee76f8b04fe41345f5e0502a
parentRemove unreachable test code. (diff)
parentOnly update rebalance time if nodes are rebalanced. (diff)
downloaddedo-1395a04d97d598ad435d89c5ef1734956b2c9f00.tar.gz
dedo-1395a04d97d598ad435d89c5ef1734956b2c9f00.tar.xz
Merge pull request #224 from benbjohnson/rebalance-time
Only update rebalance time if nodes are rebalanced
-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()