Skip to content

Commit 0078d90

Browse files
Fix metrics gathering (#494)
Should have used available and not total
1 parent 40a827f commit 0078d90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/ping/build.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ func pingAttributes(info *version.Info, pods []string, minKubeletVersion, openSh
5353
}
5454

5555
cp.InsightComponents = lo.ToSlicePtr(cInsights)
56-
if metrics.CPUTotalMillicores > 0 {
57-
cp.CPUTotal = lo.ToPtr(float64(metrics.CPUTotalMillicores))
56+
if metrics.CPUAvailableMillicores > 0 {
57+
cp.CPUTotal = lo.ToPtr(float64(metrics.CPUAvailableMillicores))
5858
}
59-
if metrics.MemoryTotalBytes > 0 {
60-
cp.MemoryTotal = lo.ToPtr(float64(metrics.MemoryTotalBytes))
59+
if metrics.MemoryAvailableBytes > 0 {
60+
cp.MemoryTotal = lo.ToPtr(float64(metrics.MemoryAvailableBytes))
6161
}
6262
if metrics.CPUUsedPercentage > 0 {
6363
cp.CPUUtil = lo.ToPtr(float64(metrics.CPUUsedPercentage))

0 commit comments

Comments
 (0)