Skip to content

Commit

Permalink
Increase precision of histogram logs and bump version suffix (#333)
Browse files Browse the repository at this point in the history
* Increase precision for floating point numbers in logs

* Bump version to `1.2.1-gardener-build.3`
  • Loading branch information
plkokanov authored Nov 6, 2024
1 parent 7614fc4 commit aef5c2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ limitations under the License.
package common

// VerticalPodAutoscalerVersion is the version of VPA.
const VerticalPodAutoscalerVersion = "1.2.1-gardener-build.2"
const VerticalPodAutoscalerVersion = "1.2.1-gardener-build.3"
6 changes: 3 additions & 3 deletions vertical-pod-autoscaler/pkg/recommender/util/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,17 @@ func (h *histogram) IsEmpty() bool {

func (h *histogram) String() string {
lines := []string{
fmt.Sprintf("minBucket: %d, maxBucket: %d, totalWeight: %.4f",
fmt.Sprintf("minBucket: %d, maxBucket: %d, totalWeight: %g",
h.minBucket, h.maxBucket, h.totalWeight),
"%-tile value: ",
}
for i := 0; i <= 100; i += 5 {
lines = append(lines, fmt.Sprintf("%d: %.4f", i, h.Percentile(0.01*float64(i))))
lines = append(lines, fmt.Sprintf("%d: %g", i, h.Percentile(0.01*float64(i))))
}

lines = append(lines, "buckets value")
for i := 0; i < h.options.NumBuckets(); i++ {
lines = append(lines, fmt.Sprintf("%d: %.4f", i, h.bucketWeight[i]))
lines = append(lines, fmt.Sprintf("%d: %g", i, h.bucketWeight[i]))
}

return strings.Join(lines, "; ")
Expand Down

0 comments on commit aef5c2a

Please sign in to comment.