Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
gunlee01 committed Jan 16, 2021
1 parent 7e3f3b9 commit ae72b66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions scouterx/strace/tctxmanager/tctxmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var ac = conf.GetInstance()
var txidMap = cachemap.New(10000)

var fEndStuckServiceForcibly func(tctx *netio.TraceContext)
var noopTctx = netio.NewTraceContext()

func RegisterEndStuckServiceForciblyFunc(f func(tctx *netio.TraceContext)) {
fEndStuckServiceForcibly = f
Expand All @@ -27,6 +28,13 @@ func Size() int {
return 0
}

func GetTraceContextFallbackNoop(ctx context.Context) *netio.TraceContext {
tctx := GetTraceContext(ctx)
if tctx == nil {
return noopTctx
}
}

func GetTraceContext(ctx context.Context) *netio.TraceContext {
traceContext, ok := ctx.Value(tctxKey).(*netio.TraceContext)
if ok {
Expand Down
1 change: 0 additions & 1 deletion scouterx/strace/tracemain.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,3 @@ func profileHttpHeaders(r http.Request, tctx *netio.TraceContext) {
tctx.Profile.Add(netdata.NewMessageStep(fmt.Sprintf("query: %s", r.URL.RawQuery), startTime))
}
}

0 comments on commit ae72b66

Please sign in to comment.