Skip to content

Commit

Permalink
Adding timing to request for fronted roundtripper
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Nov 15, 2024
1 parent 209e813 commit ddfdb52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ func (fctx *FrontingContext) ConfigureWithHello(pool *x509.CertPool, providers m
// If the context isn't configured within the given timeout, this method
// returns nil, false.
func (fctx *FrontingContext) NewFronted(timeout time.Duration) (http.RoundTripper, bool) {
start := time.Now()
instance, ok := fctx.instance.Get(timeout)
if !ok {
log.Errorf("No DirectHttpClient available within %v for context %s", timeout, fctx.name)
return nil, false
} else {
log.Debugf("DirectHttpClient available for context %s", fctx.name)
log.Debugf("DirectHttpClient available for context %s after %v", fctx.name, time.Since(start))
}
return instance.(http.RoundTripper), true
}
Expand Down

0 comments on commit ddfdb52

Please sign in to comment.