From 83a8364116131a00d31738ce1d12d732fa301b59 Mon Sep 17 00:00:00 2001 From: zhaoxiangchun <1422928955@qq.com> Date: Wed, 31 Mar 2021 10:14:46 +0800 Subject: [PATCH] fix(host): modification of netio collection field of local virtual machine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.本地虚拟机指标保存时field存在转换关系 bits_recv bits_sent --- pkg/hostman/hostmetrics/hostmetrics.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/hostman/hostmetrics/hostmetrics.go b/pkg/hostman/hostmetrics/hostmetrics.go index 77b1de280e..8b72247e35 100644 --- a/pkg/hostman/hostmetrics/hostmetrics.go +++ b/pkg/hostman/hostmetrics/hostmetrics.go @@ -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