Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
fix: quit on missing metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
  • Loading branch information
ckotzbauer committed Jul 3, 2021
1 parent aec69f7 commit f54c75a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func calculate(usageMetric, requestMetric, limitMetric *model.SampleStream, anal
var avgLimits float64
var avgLimitCounter float64

if usageMetric == nil || requestMetric == nil || limitMetric == nil {
return
}

for i := 0; i < len(usageMetric.Values); i++ {
usg := usageMetric.Values[i]
req := findPair(requestMetric.Values, usg.Timestamp)
Expand Down

0 comments on commit f54c75a

Please sign in to comment.