Re: [go-nuts] Re: Measuring the total time of serving a request

2023-11-21 Thread Ulrich Kunitz
You are right Flush needs to write the header first, so the additional header lines cannot be added by the server after Flush. The automatic Content-Type might also not be written. A local proxy in front of your server might be a simpler approach to measure full performance. If the actual processi

Re: [go-nuts] Re: Measuring the total time of serving a request

2023-11-21 Thread Mitar
Hi! On Mon, Nov 20, 2023 at 10:51 PM Uli Kunitz wrote: > You could convert the original ResponseWriter to a ResponseController and > call Flush in your middleware before you measure the duration. Alternatively > you can try to convert ResponseWriter to a http.Flusher and call Flush if the > co

Re: [go-nuts] Re: Measuring the total time of serving a request

2023-11-20 Thread Uli Kunitz
You could convert the original ResponseWriter to a ResponseController and call Flush in your middleware before you measure the duration. Alternatively you can try to convert ResponseWriter to a http.Flusher and call Flush if the conversion is successful. The documentation says "Flush flushes bu

Re: [go-nuts] Re: Measuring the total time of serving a request

2023-11-20 Thread Mitar
Hi! On Mon, Nov 20, 2023 at 10:26 AM Duncan Harris wrote: > Why do you care about buffering in Go vs the OS? Just because I hope that in Go I might have a chance to know when they are written out than in OS. Mitar -- https://mitar.tnode.com/ https://twitter.com/mitar_m https://noc.social/@mi