diff options
-rw-r--r-- | bucket.go | 6 | ||||
-rw-r--r-- | bucket_test.go | 6 |
2 files changed, 6 insertions, 6 deletions
@@ -350,8 +350,8 @@ func (b *Bucket) Stat() *BucketStat { s.BranchOverflowN += int(p.overflow) } - if depth+1 > s.MaxDepth { - s.MaxDepth = (depth + 1) + if depth+1 > s.Depth { + s.Depth = (depth + 1) } }) s.BranchAlloc = (s.BranchPageN + s.BranchOverflowN) * pageSize @@ -522,7 +522,7 @@ type BucketStat struct { LeafPageN int LeafOverflowN int KeyN int - MaxDepth int + Depth int BranchAlloc int BranchInuse int LeafAlloc int diff --git a/bucket_test.go b/bucket_test.go index 740afd8..33f0f31 100644 --- a/bucket_test.go +++ b/bucket_test.go @@ -496,7 +496,7 @@ func TestBucket_Stat(t *testing.T) { assert.Equal(t, stat.LeafPageN, 6) assert.Equal(t, stat.LeafOverflowN, 2) assert.Equal(t, stat.KeyN, 501) - assert.Equal(t, stat.MaxDepth, 2) + assert.Equal(t, stat.Depth, 2) if os.Getpagesize() != 4096 { // Incompatible page size assert.Equal(t, stat.BranchInuse, 125) @@ -530,7 +530,7 @@ func TestBucket_Stat_Small(t *testing.T) { assert.Equal(t, stat.LeafPageN, 1) assert.Equal(t, stat.LeafOverflowN, 0) assert.Equal(t, stat.KeyN, 1) - assert.Equal(t, stat.MaxDepth, 1) + assert.Equal(t, stat.Depth, 1) if os.Getpagesize() != 4096 { // Incompatible page size assert.Equal(t, stat.BranchInuse, 0) @@ -568,7 +568,7 @@ func TestBucket_Stat_Large(t *testing.T) { assert.Equal(t, stat.LeafPageN, 1281) assert.Equal(t, stat.LeafOverflowN, 0) assert.Equal(t, stat.KeyN, 100000) - assert.Equal(t, stat.MaxDepth, 3) + assert.Equal(t, stat.Depth, 3) if os.Getpagesize() != 4096 { // Incompatible page size assert.Equal(t, stat.BranchInuse, 27289) |