swarm/storage/localstore: add MetricsPrefix option

This commit is contained in:
Janos Guljas 2018-12-19 16:18:40 +01:00
parent cb8078e53d
commit c9f51302df

View file

@ -111,6 +111,8 @@ type Options struct {
// Capacity is a limit that triggers garbage collection when
// number of items in gcIndex equals or exceeds it.
Capacity int64
// MetricsPrefix defines a prefix for metrics names.
MetricsPrefix string
}
// New returns a new DB. All fields and indexes are initialized
@ -138,7 +140,7 @@ func New(path string, baseKey []byte, o *Options) (db *DB, err error) {
db.updateGCSem = make(chan struct{}, maxParallelUpdateGC)
}
db.shed, err = shed.NewDB(path)
db.shed, err = shed.NewDB(path, o.MetricsPrefix)
if err != nil {
return nil, err
}