From c2d21273dff09bae912ed0478871b70fe9c290d1 Mon Sep 17 00:00:00 2001 From: yinchengfeng Date: Wed, 27 Nov 2019 12:39:04 +0800 Subject: [PATCH] fix wrong use SwapInSet when push Swap Out Metric Signed-off-by: YINChengfeng cfengyin@gmail.com --- pkg/monitoring/vms/prometheus/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/monitoring/vms/prometheus/prometheus.go b/pkg/monitoring/vms/prometheus/prometheus.go index 7ab1d041884a..7dde310543f2 100644 --- a/pkg/monitoring/vms/prometheus/prometheus.go +++ b/pkg/monitoring/vms/prometheus/prometheus.go @@ -192,7 +192,7 @@ func updateMemory(vmi *k6tv1.VirtualMachineInstance, vmStats *stats.DomainStats, ) tryToPushMetric(swapTrafficDesc, mv, err, ch) } - if vmStats.Memory.SwapInSet { + if vmStats.Memory.SwapOutSet { mv, err := prometheus.NewConstMetric( swapTrafficDesc, prometheus.GaugeValue, // the libvirt value is in KiB