Skip to content

Commit

Permalink
Add hack to avoid emitting 0 value for metric
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Dec 14, 2020
1 parent 4448bbf commit e2b88ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ func (e *Engine) processMetrics(globalCtx context.Context, processMetricsAfterRu
if !e.NoThresholds {
e.processThresholds()
}
if iim, ok := e.Metrics[metrics.InterruptedIterations.Name]; ok {
if sink, ok := iim.Sink.(*stats.RateSink); ok {
// HACK: This is done to avoid emitting a 0 value for this
// metric on each iteration but still get a correct
// calculation in the summary.
sink.Total += int64(e.executionState.GetFullIterationCount())
}
}
processMetricsAfterRun <- struct{}{}

case sc := <-e.Samples:
Expand Down

0 comments on commit e2b88ab

Please sign in to comment.