func getCurrentNodeStat(mresp *stats.MessageResponse) { if currentStat, err := stats.GetStats(*flName); err == nil { log.Debug("Current stat:", currentStat) mresp.Nodes[*flName] = currentStat } else { log.Error("Failed to get node stats:", err) mresp.Error = err.Error() } }
func getAllNodesStats(mresp *stats.MessageResponse) { if len(globalNodes) == 0 { return } if allStats, err := collect(); err == nil { for _, nodeStat := range allStats { mresp.Nodes[nodeStat.Name] = nodeStat } } else { mresp.Error = err.Error() } }