code: func NewDB(path string, metricsPrefix string) (db *DB, err error) {
  	ldb, err := leveldb.OpenFile(path, &opt.Options{
  		OpenFilesCacheCapacity: openFileLimit,
  	})
  	if err != nil {
  		return nil, err
  	}
  	db = &DB{
  		ldb: ldb,
  	}
  
  	if _, err = db.getSchema(); err != nil {
  		if err == leveldb.ErrNotFound {
  			// save schema with initialized default fields
  			if err = db.putSchema(schema{
  				Fields:  make(map[string]fieldSpec),
  				Indexes: make(map[byte]indexSpec),
  			}); err != nil {
  				return nil, err
  			}
  		} else {
  			return nil, err
  		}
  	}
  
  	// Configure meters for DB
  	db.configure(metricsPrefix)
  
  	// Create a quit channel for the periodic metrics collector and run it
  	db.quit = make(chan struct{})
  
  	go db.meter(10 * time.Second)
  
  	return db, nil
  }
docs: // NewDB constructs a new DB and validates the schema
  // if it exists in database on the given path.
  // metricsPrefix is used for metrics collection for the given DB.