コード例 #1
0
ファイル: heartbeat.go プロジェクト: simonleung8/bosh
func updateWithCpuLoad(platform boshplatform.Platform, hb boshmbus.Heartbeat) (updatedHb boshmbus.Heartbeat) {
	updatedHb = hb

	load, err := platform.GetCpuLoad()
	if err != nil {
		return
	}

	one := fmt.Sprintf("%.2f", load.One)
	five := fmt.Sprintf("%.2f", load.Five)
	fifteen := fmt.Sprintf("%.2f", load.Fifteen)

	updatedHb.Vitals.CpuLoad = []string{one, five, fifteen}

	return
}