Skip to content

Commit

Permalink
Add execution log in proxy function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyaw Myint Thein committed Sep 27, 2021
1 parent a988175 commit de06298
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions twirp.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ func NewConfiguredBackendFactory(l logging.Logger, ref func(*config.Backend) cli
}

return func(ctx context.Context, request *proxy.Request) (*proxy.Response, error) {
start := time.Now()
defer func(logger logging.Logger) {
elapsed := time.Since(start)
logger.Info("ProxyFunc time : %s", elapsed)
}(l)
req, err := convertProxyRequest2HttpRequest(request)
if err != nil {
return nil, err
Expand Down

0 comments on commit de06298

Please sign in to comment.