Skip to content

Commit

Permalink
Add timing to Execute
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrobenolt committed Jan 17, 2024
1 parent 31624e6 commit 93c8852
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Expand Up @@ -268,14 +268,17 @@ func (server) Execute(

ll.Info("ok")

start := time.Now()
// This is a gross simplificiation, but is likely sufficient
qr, err := conn.ExecuteFetch(query, int(*flagMySQLMaxRows), true)
timing := time.Since(start)
session.Update(qr, sess)

return connect.NewResponse(&psdbv1alpha1.ExecuteResponse{
Session: sess,
Result: vitess.ResultToProto(qr),
Error: vitess.ToVTRPC(err),
Timing: timing.Seconds(),
}), nil
}

Expand Down

0 comments on commit 93c8852

Please sign in to comment.