Skip to content

Commit

Permalink
always processing OOM samples
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysied committed Apr 22, 2020
1 parent 40d5205 commit c361a5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vertical-pod-autoscaler/pkg/recommender/model/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ func (container *ContainerState) GetMaxMemoryPeak() ResourceAmount {

func (container *ContainerState) addMemorySample(sample *ContainerUsageSample, isOOM bool) bool {
ts := sample.MeasureStart
if !sample.isValid(ResourceMemory) || ts.Before(container.lastMemorySampleStart) {
// We always process OOM samples.
if !sample.isValid(ResourceMemory) ||
(!isOOM && ts.Before(container.lastMemorySampleStart)) {
return false // Discard invalid or outdated samples.
}
container.lastMemorySampleStart = ts
Expand Down

0 comments on commit c361a5e

Please sign in to comment.