boltdb/bolt — pull request #49 by benbjohnson (2014-02-21 16:53:03+00:00)
Title: Database Stats

## Overview

This pull request includes a function, `DB.Stat()`, that can be used for calculating database stats:

```
type Stat struct {
// PageCount is the total number of allocated pages. This is a high water
// mark in the database that represents how many pages have actually been
// used. This will be smaller than the MmapSize / PageSize.
PageCount int

// FreePageCount is the total number of pages which have been previously
// allocated but are no longer used.
FreePageCount int

// PageSize is the size, in bytes, of individual database pages.
PageSize int

// MmapSize is the mmap-allocated size of the data file. When the data file
// grows beyond this size, the database will obtain a lock on the mmap and
// resize it.
MmapSize int

// TransactionCount is the total number of reader transactions.
TransactionCount int
}
```