Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
fix ut
  • Loading branch information
kevinteng525 committed Jan 6, 2023
1 parent c62d21a commit d672478
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/scaling/scale_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ func (h *scaleHandler) GetScaledObjectMetrics(ctx context.Context, scaledObjectN
}

if !metricsFoundInCache {
metrics, latency, err := cache.GetMetricsForScaler(ctx, scalerIndex, metricName)
var latency int64
metrics, latency, err = cache.GetMetricsForScaler(ctx, scalerIndex, metricName)
if latency != -1 {
prommetrics.RecordScalerLatency(scaledObjectNamespace, scaledObject.Name, scalerName, scalerIndex, metricName, float64(latency))
}
Expand Down

0 comments on commit d672478

Please sign in to comment.