Skip to content

Commit

Permalink
kernel bug lead to StatefulSet pod metric residue old node and then l…
Browse files Browse the repository at this point in the history
…ead to cpu usage value is very large
  • Loading branch information
sleepyzhang committed Jul 30, 2023
1 parent 796fc0f commit 82a7323
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ type MetricsPoint struct {
}

func resourceUsage(last, prev MetricsPoint) (corev1.ResourceList, api.TimeInfo, error) {
if last.StartTime.Before(prev.StartTime) {
return corev1.ResourceList{}, api.TimeInfo{}, fmt.Errorf("unexpected decrease in startTime of node/container")
}
if last.CumulativeCpuUsed < prev.CumulativeCpuUsed {
return corev1.ResourceList{}, api.TimeInfo{}, fmt.Errorf("unexpected decrease in cumulative CPU usage value")
}
Expand Down

0 comments on commit 82a7323

Please sign in to comment.