lotus/stats.go

23 lines
505 B
Go
Raw Normal View History

2020-03-23 14:56:22 +00:00
package sectorstorage
import "github.com/filecoin-project/sector-storage/storiface"
2020-03-23 14:56:22 +00:00
func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats {
2020-03-23 14:56:22 +00:00
m.workersLk.Lock()
defer m.workersLk.Unlock()
out := map[uint64]storiface.WorkerStats{}
2020-03-23 14:56:22 +00:00
for id, handle := range m.workers {
out[uint64(id)] = storiface.WorkerStats{
2020-03-23 14:56:22 +00:00
Info: handle.info,
MemUsedMin: handle.memUsedMin,
MemUsedMax: handle.memUsedMax,
GpuUsed: handle.gpuUsed,
CpuUse: handle.cpuUse,
}
}
return out
}