Skip to content

Commit

Permalink
fix: proposed_memory_request to byte (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho authored Oct 3, 2023
1 parent 13e6465 commit 02d58ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (

ProposedMemoryRequest = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "proposed_memory_request",
Help: "recommended memory request (millibyte) that tortoises propose",
Help: "recommended memory request (byte) that tortoises propose",
}, []string{"tortoise_name", "namespace", "container_name", "controller_name", "controller_kind"})
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/vpa/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (c *Service) UpdateVPAFromTortoiseRecommendation(ctx context.Context, torto
metrics.ProposedCPURequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName, tortoise.Spec.TargetRefs.DeploymentName, "Deployment").Set(float64(value.MilliValue()))
}
if resourcename == corev1.ResourceMemory {
metrics.ProposedMemoryRequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName, tortoise.Spec.TargetRefs.DeploymentName, "Deployment").Set(float64(value.MilliValue()))
metrics.ProposedMemoryRequest.WithLabelValues(tortoise.Name, tortoise.Namespace, r.ContainerName, tortoise.Spec.TargetRefs.DeploymentName, "Deployment").Set(float64(value.Value()))
}
}
metricsRecorded = true
Expand Down

0 comments on commit 02d58ad

Please sign in to comment.