2020-11-19 13:54:21 +00:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
2020-11-19 13:54:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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 {
|
2022-01-31 15:23:19 +00:00
|
|
|
info := sh.DumpInfo()
|
|
|
|
info.ErrorCount = sh.errorCount.Load()
|
|
|
|
i.Shards = append(i.Shards, info)
|
2020-11-19 13:54:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|