Skip to content

Commit

Permalink
start api call method
Browse files Browse the repository at this point in the history
  • Loading branch information
gunlee01 committed Jan 20, 2021
1 parent c92390c commit f36afc9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scouterx/strace/tracemain.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func StartApiCall(ctx context.Context, apiCallName string, address string) *netd
return step
}

func EndApiCall(ctx context.Context, step *netdata.MethodStep) {
func EndApiCall(ctx context.Context, step *netdata.ApiCallStep, err error) {
defer common.ReportScouterPanic()

if ctx == nil || step == nil {
Expand All @@ -549,6 +549,12 @@ func EndApiCall(ctx context.Context, step *netdata.MethodStep) {
return
}
step.Elapsed = util.MillisToNow(tctx.StartTime) - step.StartTime
if err != nil {
step.Error = netio.SendError(err.Error())
if tctx.Error == 0 {
tctx.Error = step.Error
}
}
tctx.Profile.Pop(step)
}

0 comments on commit f36afc9

Please sign in to comment.