Skip to content

Commit

Permalink
修复链路问题
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Nov 30, 2024
1 parent 64c844f commit f9e46a1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
23 changes: 23 additions & 0 deletions trace/traceDetailHand.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package trace

import (
"fmt"
)

// TraceDetailHand 手动埋点
type TraceDetailHand struct {
BaseTraceDetail
Name string
}

func (receiver *TraceDetailHand) GetTraceDetail() *BaseTraceDetail {
return &receiver.BaseTraceDetail
}

func (receiver *TraceDetailHand) ToString() string {
return fmt.Sprintf("[%s]耗时:%s, %s", receiver.CallType.ToString(), receiver.UseTs.String(), receiver.Name)
}

func (receiver *TraceDetailHand) SetName(name string) {
receiver.Name = name
}
5 changes: 4 additions & 1 deletion trace/trackContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ func (receiver *TraceContext) IgnoreDetail(f func()) {
receiver.ignoreDetail = false
}()

traceDetail := NewTraceDetail(eumCallType.Hand, "")
traceDetail := TraceDetailHand{
BaseTraceDetail: NewTraceDetail(eumCallType.Hand, ""),
Name: "忽略明细",
}
traceDetail.Comment = "忽略明细"
traceDetail.Timeline = time.Duration(traceDetail.StartTs-receiver.StartTs) * time.Microsecond
if len(receiver.List) > 0 {
Expand Down

0 comments on commit f9e46a1

Please sign in to comment.