From 686b6a334173c40ae91d3cdd7d7d759bf8851df6 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Wed, 2 Apr 2014 15:36:53 -0600 Subject: Add performance counters. This commit adds performance counters for each transaction which are rolled up to the database level on each commit/rollback. Counters are meant to be a very fast way to track what is going on in the database. A few timers are also added in areas where the time.Now() overhead is not noticible. The DB.Stat() function is now deprecated since the `bolt` CLI now performs similar functions. Fixes #108. --- node.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'node.go') diff --git a/node.go b/node.go index 0a4c7af..709c0ca 100644 --- a/node.go +++ b/node.go @@ -233,6 +233,9 @@ func (n *node) rebalance() { } n.unbalanced = false + // Update statistics. + n.tx.stats.Rebalance++ + // Ignore if node is above threshold (25%) and has enough keys. var threshold = n.tx.db.pageSize / 4 if n.size() > threshold && len(n.inodes) > n.minKeys() { -- cgit v1.2.3