From 373d81256fe8e8d99e9eff1f18ad3a5dec43227d Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Wed, 8 Sep 2021 14:40:50 +0100
Subject: [PATCH] Fix PSI time metrics (usecs vs secs)

---
 cpu_v2.go | 4 ++--
 io_v2.go  | 4 ++--
 mem_v2.go | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cpu_v2.go b/cpu_v2.go
index 39d4d30..b4af71e 100644
--- a/cpu_v2.go
+++ b/cpu_v2.go
@@ -56,13 +56,13 @@ func (p *cpuV2Parser) parse(path, slice, unit string, ch chan<- prometheus.Metri
 		ch <- prometheus.MustNewConstMetric(
 			cpuV2PressureWaitingDesc,
 			prometheus.CounterValue,
-			float64(waiting),
+			float64(waiting)/usecs,
 			slice, unit,
 		)
 		ch <- prometheus.MustNewConstMetric(
 			cpuV2PressureStalledDesc,
 			prometheus.CounterValue,
-			float64(stalled),
+			float64(stalled)/usecs,
 			slice, unit,
 		)
 	}
diff --git a/io_v2.go b/io_v2.go
index a7a0e70..fd68241 100644
--- a/io_v2.go
+++ b/io_v2.go
@@ -149,13 +149,13 @@ func (p *blkioV2Parser) parse(path, slice, unit string, ch chan<- prometheus.Met
 		ch <- prometheus.MustNewConstMetric(
 			ioV2PressureWaitingDesc,
 			prometheus.CounterValue,
-			float64(waiting),
+			float64(waiting)/usecs,
 			slice, unit,
 		)
 		ch <- prometheus.MustNewConstMetric(
 			ioV2PressureStalledDesc,
 			prometheus.CounterValue,
-			float64(stalled),
+			float64(stalled)/usecs,
 			slice, unit,
 		)
 	}
diff --git a/mem_v2.go b/mem_v2.go
index 838cdac..723dcec 100644
--- a/mem_v2.go
+++ b/mem_v2.go
@@ -48,13 +48,13 @@ func (p *memoryV2Parser) parse(path, slice, unit string, ch chan<- prometheus.Me
 		ch <- prometheus.MustNewConstMetric(
 			memV2PressureWaitingDesc,
 			prometheus.CounterValue,
-			float64(waiting),
+			float64(waiting)/usecs,
 			slice, unit,
 		)
 		ch <- prometheus.MustNewConstMetric(
 			memV2PressureStalledDesc,
 			prometheus.CounterValue,
-			float64(stalled),
+			float64(stalled)/usecs,
 			slice, unit,
 		)
 	}
-- 
GitLab