forked from TrueCloudLab/frostfs-node
[#189] localstorage: Implement DumpInfo method
Implement method to get the information about the local storage. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8fbda2a588
commit
4f16a10235
1 changed files with 24 additions and 0 deletions
24
pkg/local_object_storage/engine/info.go
Normal file
24
pkg/local_object_storage/engine/info.go
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
package engine
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Info groups the information about StorageEngine.
|
||||||
|
type Info struct {
|
||||||
|
Shards []shard.Info
|
||||||
|
}
|
||||||
|
|
||||||
|
// DumpInfo returns information about the StorageEngine.
|
||||||
|
func (e *StorageEngine) DumpInfo() (i Info) {
|
||||||
|
e.mtx.RLock()
|
||||||
|
defer e.mtx.RUnlock()
|
||||||
|
|
||||||
|
i.Shards = make([]shard.Info, 0, len(e.shards))
|
||||||
|
|
||||||
|
for _, sh := range e.shards {
|
||||||
|
i.Shards = append(i.Shards, sh.DumpInfo())
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
Loading…
Reference in a new issue