MCPcopy Create free account
hub / github.com/eth-easl/dirigent / getWorkerStatistics

Method getWorkerStatistics

internal/worker_node/worker_node.go:223–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221}
222
223func (w *WorkerNode) getWorkerStatistics() (*proto.NodeHeartbeatMessage, error) {
224 hardwareUsage := hardware.GetHardwareUsage()
225
226 return &proto.NodeHeartbeatMessage{
227 NodeID: w.Name,
228 CpuUsage: hardwareUsage.CpuUsage,
229 MemoryUsage: hardwareUsage.MemoryUsage,
230 }, nil
231}
232
233func (w *WorkerNode) sendHeartbeatLoop(cfg *config.WorkerNodeConfig) {
234 pollContext, cancel := context.WithTimeout(context.Background(), 5*time.Second)

Callers 1

sendHeartbeatLoopMethod · 0.95

Calls 1

GetHardwareUsageFunction · 0.92

Tested by

no test coverage detected