-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(recommender): add round cpu millicores #7682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8e26139
64a921c
06504c2
57580b9
6645e94
a6a1e1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,7 @@ var ( | |
| lowerBoundMemoryPercentile = flag.Float64("recommendation-lower-bound-memory-percentile", 0.5, `Memory usage percentile that will be used for the lower bound on memory recommendation.`) | ||
| upperBoundMemoryPercentile = flag.Float64("recommendation-upper-bound-memory-percentile", 0.95, `Memory usage percentile that will be used for the upper bound on memory recommendation.`) | ||
| humanizeMemory = flag.Bool("humanize-memory", false, "Convert memory values in recommendations to the highest appropriate SI unit with up to 2 decimal places for better readability.") | ||
| roundCPUMillicores = flag.Int("round-cpu-millicores", 1, `CPU recommendation rounding factor in millicores. The CPU value will be rounded to the nearest multiple of this factor.`) | ||
|
||
| ) | ||
|
|
||
| // PodResourceRecommender computes resource recommendation for a Vpa object. | ||
|
|
@@ -189,10 +190,10 @@ func MapToListOfRecommendedContainerResources(resources RecommendedPodResources) | |
| for _, name := range containerNames { | ||
| containerResources = append(containerResources, vpa_types.RecommendedContainerResources{ | ||
| ContainerName: name, | ||
| Target: model.ResourcesAsResourceList(resources[name].Target, *humanizeMemory), | ||
| LowerBound: model.ResourcesAsResourceList(resources[name].LowerBound, *humanizeMemory), | ||
| UpperBound: model.ResourcesAsResourceList(resources[name].UpperBound, *humanizeMemory), | ||
| UncappedTarget: model.ResourcesAsResourceList(resources[name].Target, *humanizeMemory), | ||
| Target: model.ResourcesAsResourceList(resources[name].Target, *humanizeMemory, *roundCPUMillicores), | ||
| LowerBound: model.ResourcesAsResourceList(resources[name].LowerBound, *humanizeMemory, *roundCPUMillicores), | ||
| UpperBound: model.ResourcesAsResourceList(resources[name].UpperBound, *humanizeMemory, *roundCPUMillicores), | ||
| UncappedTarget: model.ResourcesAsResourceList(resources[name].Target, *humanizeMemory, *roundCPUMillicores), | ||
| }) | ||
| } | ||
| recommendation := &vpa_types.RecommendedPodResources{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for adding docs as the feature is added! This is a habit we need to be getting into
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup! Thank you :)