fix(host): modification of netio collection field of local virtual machine

1.本地虚拟机指标保存时field存在转换关系
bits_recv
bits_sent
This commit is contained in:
zhaoxiangchun
2021-03-31 10:33:18 +08:00
parent 9f4880b3d1
commit 83a8364116
+8 -8
View File
@@ -499,14 +499,14 @@ func (m *SGuestMonitor) Netio() jsonutils.JSONObject {
uptime, _ := host.Uptime()
meta.Set("uptime", jsonutils.NewInt(int64(uptime)))
data.Set("meta", meta)
data.Set("bps_sent", jsonutils.NewInt(int64(nicStat.BytesRecv*8)))
data.Set("bps_recv", jsonutils.NewInt(int64(nicStat.BytesSent*8)))
data.Set("packets_sent", jsonutils.NewInt(int64(nicStat.PacketsRecv)))
data.Set("packets_recv", jsonutils.NewInt(int64(nicStat.PacketsSent)))
data.Set("err_in", jsonutils.NewInt(int64(nicStat.Errout)))
data.Set("err_out", jsonutils.NewInt(int64(nicStat.Errin)))
data.Set("drop_in", jsonutils.NewInt(int64(nicStat.Dropout)))
data.Set("drop_out", jsonutils.NewInt(int64(nicStat.Dropin)))
data.Set("bits_recv", jsonutils.NewInt(int64(nicStat.BytesRecv*8)))
data.Set("bits_sent", jsonutils.NewInt(int64(nicStat.BytesSent*8)))
data.Set("packets_recv", jsonutils.NewInt(int64(nicStat.PacketsRecv)))
data.Set("packets_sent", jsonutils.NewInt(int64(nicStat.PacketsSent)))
data.Set("err_out", jsonutils.NewInt(int64(nicStat.Errout)))
data.Set("err_in", jsonutils.NewInt(int64(nicStat.Errin)))
data.Set("drop_out", jsonutils.NewInt(int64(nicStat.Dropout)))
data.Set("drop_in", jsonutils.NewInt(int64(nicStat.Dropin)))
res.Add(data)
}
return res