Skip to content

Commit

Permalink
移除过滤器的埋点
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Jan 20, 2024
1 parent 97c3fe0 commit cd27699
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions minimal/handleMiddleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package minimal

import (
"github.com/farseer-go/fs/container"
"github.com/farseer-go/fs/parse"
"github.com/farseer-go/fs/trace"
"github.com/farseer-go/webapi/context"
"reflect"
Expand All @@ -12,16 +11,9 @@ type HandleMiddleware struct {
}

func (receiver HandleMiddleware) Invoke(httpContext *context.HttpContext) {

// 执行过滤器OnActionExecuting
for i := 0; i < len(httpContext.Route.Filters); i++ {
traceFiltersDetail := container.Resolve[trace.IManager]().TraceHand("执行过滤器OnActionExecuting:" + parse.ToString(i+1))
httpContext.Route.Filters[i].OnActionExecuting(httpContext)
traceFiltersDetail.End(nil)
// 约定小于1us,不显示
if traceFiltersDetail.GetTraceDetail().UnTraceTs.Microseconds() <= 1 {
traceFiltersDetail.Ignore()
}
}

traceDetail := container.Resolve[trace.IManager]().TraceHand("执行路由")
Expand All @@ -32,12 +24,6 @@ func (receiver HandleMiddleware) Invoke(httpContext *context.HttpContext) {

// 执行过滤器OnActionExecuted
for i := 0; i < len(httpContext.Route.Filters); i++ {
traceFiltersDetail := container.Resolve[trace.IManager]().TraceHand("执行过滤器OnActionExecuted" + parse.ToString(i+1))
httpContext.Route.Filters[i].OnActionExecuted(httpContext)
traceFiltersDetail.End(nil)
// 约定小于1us,不显示
if traceFiltersDetail.GetTraceDetail().UnTraceTs.Microseconds() <= 1 {
traceFiltersDetail.Ignore()
}
}
}

0 comments on commit cd27699

Please sign in to comment.