Commit c01ba4b9 authored by duanjinfei's avatar duanjinfei

update device msg resp

parent 4912c624
......@@ -158,8 +158,8 @@ func DeviceInfoResp(params ...interface{}) *nodemanagerV2.WorkerMessage {
func DeviceUsageResp(params ...interface{}) *nodemanagerV2.WorkerMessage {
log.Info("DeviceUsageResp params :", params)
hardwareInfo := GetHardwareInfo()
ramUsage := int32((1 - float64(hardwareInfo.RAM.Total)/float64(hardwareInfo.RAM.Free)) * 100)
diskUsage := int32((1 - float64(hardwareInfo.DISK.Total)/float64(hardwareInfo.DISK.Free)) * 100)
ramUsage := int32((1 - float64(hardwareInfo.RAM.Free)/float64(hardwareInfo.RAM.Total)) * 100)
diskUsage := int32((1 - float64(hardwareInfo.DISK.Free)/float64(hardwareInfo.DISK.Total)) * 100)
deviceInfoRes := &nodemanagerV2.WorkerMessage{
Message: &nodemanagerV2.WorkerMessage_DeviceUsage{
DeviceUsage: &nodemanagerV2.DeviceUsageResponse{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment