Skip to content

Commit

Permalink
fix: workflow.duration' is not available as a real time metric (#8181)
Browse files Browse the repository at this point in the history
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
  • Loading branch information
sarabala1979 authored Mar 18, 2022
1 parent 0e707cd commit fbb43b2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions workflow/controller/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,7 @@ func (woc *wfOperationCtx) prepareDefaultMetricScope() (map[string]string, map[s
}

func (woc *wfOperationCtx) prepareMetricScope(node *wfv1.NodeStatus) (map[string]string, map[string]func() float64) {
realTimeScope := make(map[string]func() float64)
localScope := woc.globalParams.DeepCopy()

localScope, realTimeScope := woc.prepareDefaultMetricScope()
if node.Fulfilled() {
localScope[common.LocalVarDuration] = fmt.Sprintf("%f", node.FinishedAt.Sub(node.StartedAt.Time).Seconds())
realTimeScope[common.LocalVarDuration] = func() float64 {
Expand Down

0 comments on commit fbb43b2

Please sign in to comment.