Go (Golang) httptrace Tutorial



Go (Golang) httptrace Tutorial

Go (Golang) httptrace Tutorial

Go (Golang) httptrace Tutorial

In this episode we are going to explore the httptrace package, a new addition to the Go standard library present from Go1.7. The httptrace package is extremely useful when doing performance analysis and tracing of your http requests when using the Go http client. It allows us to measure and inspect the events happening during the creation and the execution of HTTP requests. Some of these events are for example, DNS resolution, TCP connection creation, Bytes written to the TCP connection, Bytes received from the server, and many more.

In this example we are also going to explore HTTP Persistent connections and how to make your Go client re-use an existing tcp connection when doing multiple HTTP requests to the same host.

HTTP Persistent Connections – https://en.wikipedia.org/wiki/HTTP_persistent_connection

httptrace package – https://golang.org/pkg/net/http/httptrace/
httptrace Blog from Golang Team – https://blog.golang.org/http-tracing

Source Code – https://play.golang.org/p/94JkmnO-wJz

💼 Golang Cafe – https://golang.cafe
📬 Golang Cafe Jobs Newsletter – https://golang.cafe/newsletter
🐦 Golang Cafe Twitter – https://twitter.com/golangcafe
📣 Telegram Channel – https://t.me/golangcafe
🙏 Found this video useful? Help me make more by donating $5.00 – https://golang.cafe/5USD

Comments are closed.