Analyze HTTP Traffic with new HTTP Instrument
Published in
5 min readOct 31, 2021
WWDC21 has been finished last week with over 200 sessions. Most of the time we heard about SwiftUI session or about Async Await. However there are also interesting session about debugging that has been described by Keith Harrison here. In this article I would like to focus on one of the underrated session which is Analyze HTTP Traffic in Instruments. I also write this article in WWDC Notes.
Track hierarchy
First is about track hierarchy. The hierarchy consists of 4 important elements :
- HTTP Traffic instruments : Number of active tasks presented
- Process : Debuggable process and background tasks daemon
- Session : Session will shown one track per
URLSession
object. During those session there will be an individual task intervals. Besides that, we can configure the session name for more clarity. - Domain
- Only task that requested in the domain
- Give more detail about tasks
- Showing individual transactions
- Describing the transaction states
let session = URLSession(configuration: .default)
session.sessionDescription = "Main Session" // 👈🏻 Custom session name
Task timing
Task timing is also part of the instruments GUI. We will able to see structural timing from the start of the request until the end of the request