func EndStep(stepData map[string][]*types.StepData, stepName string, tag map[string]interface{}, err error) {
	if len(stepName) == 0 {
		log.Error("error while updating step data for Granular Metrics: step name can't be empty for stepData")
		return
	}
	var ok bool

	stepValues, ok := stepData[stepName]
	if !ok {
		log.Errorf("key %s not exist in stepData %+v", stepName, stepData)
		return
	}
	if len(stepValues) < 1 {
		log.Errorf("len of stepValues is %d, less than 1", len(stepValues))
		return
	}

	step := stepValues[len(stepValues)-1]
	step.Tags = tag
	step.EndTime = time.Now().Unix()
	step.ErrorMsg = err
	step.ExecTimeMS = (step.EndTime - step.StartTime) * 1000
	if err != nil {
		step.Status = "Error"
	} else {
		step.Status = "Success"
	}
}
// EndStep ends the current dce step, and update the result, duraiton.
// current dce step can be fetch from stepData, key is the stepName, value is each retry results. Update the latest result
EndStep ends the current dce step, and update the result, duraiton.
current dce step can be fetch from stepData, key is the stepName, value is each retry results. Update the latest result
// EndStep ends the current dce step and update the result duraiton . // current dce step can be fetch from stepData key is the stepName value is each retry results . Update the latest result
func EndStep(stepData map[string][]*types.StepData, stepName string, tag map[string]interface{}, err error) {
	if len(stepName) == 0 {
		log.Error("error while updating step data for Granular Metrics: step name can't be empty for stepData")
		return
	}
	var ok bool
	stepValues, ok := stepData[stepName]
	if !ok {
		log.Errorf("key %s not exist in stepData %+v", stepName, stepData)
		return
	}
	if len(stepValues) < 1 {
		log.Errorf("len of stepValues is %d, less than 1", len(stepValues))
		return
	}
	step := stepValues[len(stepValues)-1]
	step.Tags = tag
	step.EndTime = time.Now().Unix()
	step.ErrorMsg = err
	step.ExecTimeMS = (step.EndTime - step.StartTime) * 1000
	if err != nil {
		step.Status = "Error"
	} else {
		step.Status = "Success"
	}
}
func EndStep ( stepData map [ string ] [ ] * types . StepData , stepName string , tag map [ string ] interface { } , err error ) { if len ( stepName ) == 0 { log . Error ( " " ) return } var ok bool stepValues , ok := stepData [ stepName ] if ! ok { log . Errorf ( " " , stepName , stepData ) return } if len ( stepValues ) < 1 { log . Errorf ( " " , len ( stepValues ) ) return } step := stepValues [ len ( stepValues ) - 1 ] step . Tags = tag step . EndTime = time . Now ( ) . Unix ( ) step . ErrorMsg = err step . ExecTimeMS = ( step . EndTime - step . StartTime ) * 1000 if err != nil { step . Status = " " } else { step . Status = " " } }
EndStep ends the current dce step, and update the result, duraiton.
EndStep ends the current dce step and update the result duraiton .