[GH-ISSUE #61] Swizzle URLSession Metrics #42

Open
opened 2026-03-03 19:11:15 +03:00 by kerem · 5 comments
Owner

Originally created by @Sherlouk on GitHub (Feb 27, 2021).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/61

Originally assigned to: @NghiaTranUIT on GitHub.

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.

Originally created by @Sherlouk on GitHub (Feb 27, 2021). Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/61 Originally assigned to: @NghiaTranUIT on GitHub. Hey! Got a bit of a feature request here 🤓 How would you feel about swizzling [this](https://developer.apple.com/documentation/foundation/urlsessiontaskdelegate/1643148-urlsession) 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](https://user-images.githubusercontent.com/15193942/109388734-d676c180-7900-11eb-8f46-316faf027ed2.png) 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.
Author
Owner

@Sherlouk commented on GitHub (Feb 27, 2021):

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.

<!-- gh-comment-id:787084789 --> @Sherlouk commented on GitHub (Feb 27, 2021): 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.
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 28, 2021):

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 🎉

<!-- gh-comment-id:787218580 --> @NghiaTranUIT commented on GitHub (Feb 28, 2021): 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 😄 <img width="660" alt="Screen Shot 2021-02-28 at 08 53 26" src="https://user-images.githubusercontent.com/5878421/109405359-6de02100-79a2-11eb-981e-75ad1367fc07.png"> I will put this feature in the next release 🎉
Author
Owner

@dioKaratzas commented on GitHub (Mar 9, 2023):

@NghiaTranUIT Any progress on that?

<!-- gh-comment-id:1462136806 --> @dioKaratzas commented on GitHub (Mar 9, 2023): @NghiaTranUIT Any progress on that?
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 10, 2023):

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

<!-- gh-comment-id:1463086079 --> @NghiaTranUIT commented on GitHub (Mar 10, 2023): Hey @dnKaratzas, I haven't worked on it yet. Which timing elements that you concerned?
Author
Owner

@dioKaratzas commented on GitHub (Mar 10, 2023):

@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

<!-- gh-comment-id:1463667343 --> @dioKaratzas commented on GitHub (Mar 10, 2023): @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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/atlantis#42
No description provided.