Skip to content

Commit

Permalink
log request parsing time
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispatrick committed Aug 21, 2024
1 parent 023c6e2 commit 7dc3be8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func Start(handlers Handlers) {

func CreateHttpHandler(handlers Handlers) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
handleStart := time.Now()
buf := new(strings.Builder)
rc := r.Body
defer rc.Close()
Expand Down Expand Up @@ -73,6 +74,8 @@ func CreateHttpHandler(handlers Handlers) func(http.ResponseWriter, *http.Reques
ctx: ctx,
}

logger.Debugf("Skill request parsed in %d ms", time.Now().UnixMilli()-handleStart.UnixMilli())

defer func() {
if err := recover(); err != nil {
sendStatus(ctx, req, Status{
Expand Down

0 comments on commit 7dc3be8

Please sign in to comment.