diff --git a/pkg/local_object_storage/engine/info.go b/pkg/local_object_storage/engine/info.go new file mode 100644 index 00000000..16683fb9 --- /dev/null +++ b/pkg/local_object_storage/engine/info.go @@ -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 +}