frostfs-node/pkg/local_object_storage/engine/info.go
Evgenii Stratonikov 7b5b735fb2 [#1550] engine: Split errors on write- and meta- errors
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-07-08 13:45:57 +03:00

26 lines
531 B
Go

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 {
info := sh.DumpInfo()
info.ErrorCount = sh.metaErrorCount.Load()
i.Shards = append(i.Shards, info)
}
return
}