frostfs-node/pkg/local_object_storage/engine/info.go
Pavel Karpy 923f84722a Move to frostfs-node
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2022-12-28 15:04:29 +03:00

26 lines
532 B
Go

package engine
import (
"github.com/TrueCloudLab/frostfs-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.errorCount.Load()
i.Shards = append(i.Shards, info)
}
return
}