mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/storage/localstore: add MetricsPrefix option
This commit is contained in:
parent
cb8078e53d
commit
c9f51302df
1 changed files with 3 additions and 1 deletions
|
|
@ -111,6 +111,8 @@ type Options struct {
|
||||||
// Capacity is a limit that triggers garbage collection when
|
// Capacity is a limit that triggers garbage collection when
|
||||||
// number of items in gcIndex equals or exceeds it.
|
// number of items in gcIndex equals or exceeds it.
|
||||||
Capacity int64
|
Capacity int64
|
||||||
|
// MetricsPrefix defines a prefix for metrics names.
|
||||||
|
MetricsPrefix string
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new DB. All fields and indexes are initialized
|
// 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.updateGCSem = make(chan struct{}, maxParallelUpdateGC)
|
||||||
}
|
}
|
||||||
|
|
||||||
db.shed, err = shed.NewDB(path)
|
db.shed, err = shed.NewDB(path, o.MetricsPrefix)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue