atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

Swizzle URLSession Metrics

Open Sherlouk opened this issue 4 years ago • 5 comments

Hey! Got a bit of a feature request here 🤓

How would you feel about swizzling this request: urlSession(_:task:didFinishCollecting:)

This is a really interesting delegate call because it gives you access to the task metrics which includes how long every part of the request took including the DNS lookup, connection, and of course the server response time.

image

It also provides more information about the request itself including the remote server details, the protocol used and whether it was on a cellular network or not.

All of this data feels useful not only for Atlantis but Proxyman too as it provides a much richer understanding of the time taken to make requests.

Sherlouk avatar Feb 27 '21 13:02 Sherlouk

Worth noting, some (most?) is only available on iOS 13+ (etc) - so should just be a nil object on incompatible versions rather than bumping the package's minimum up.

Sherlouk avatar Feb 27 '21 14:02 Sherlouk

Thanks for opening this ticket @Sherlouk

I suppose that I should support your request soon and show the data in the Summary Tab on Proxyman macOS 😄

Screen Shot 2021-02-28 at 08 53 26

I will put this feature in the next release 🎉

NghiaTranUIT avatar Feb 28 '21 01:02 NghiaTranUIT

@NghiaTranUIT Any progress on that?

dioKaratzas avatar Mar 09 '23 14:03 dioKaratzas

Hey @dnKaratzas, I haven't worked on it yet. Which timing elements that you concerned?

NghiaTranUIT avatar Mar 10 '23 01:03 NghiaTranUIT

@NghiaTranUIT I am working on an In-App request browser by using Atlantis Delegate to grab the TrafficPackages. I want to get the Request/Response headers/body size. It would be nice if we can get the Metrics from the urlSession(_:task:didFinishCollecting:). Tried to swizzle that method but seems more complicated than the others

dioKaratzas avatar Mar 10 '23 11:03 dioKaratzas