{"id":28951011,"url":"https://github.com/nrkno/tumbleweed","last_synced_at":"2025-06-23T14:07:51.915Z","repository":{"id":56924573,"uuid":"87536673","full_name":"nrkno/Tumbleweed","owner":"nrkno","description":"Logs detailed metrics about NSURLSession tasks to the console","archived":false,"fork":false,"pushed_at":"2017-04-07T13:04:52.000Z","size":29,"stargazers_count":52,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-08T00:57:01.793Z","etag":null,"topics":["logging","metrics","stats","swift","urlsession"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nrkno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-07T10:56:36.000Z","updated_at":"2024-11-02T00:02:05.000Z","dependencies_parsed_at":"2022-08-20T22:50:20.764Z","dependency_job_id":null,"html_url":"https://github.com/nrkno/Tumbleweed","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nrkno/Tumbleweed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrkno%2FTumbleweed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrkno%2FTumbleweed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrkno%2FTumbleweed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrkno%2FTumbleweed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nrkno","download_url":"https://codeload.github.com/nrkno/Tumbleweed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrkno%2FTumbleweed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261491821,"owners_count":23166678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","metrics","stats","swift","urlsession"],"created_at":"2025-06-23T14:07:50.924Z","updated_at":"2025-06-23T14:07:51.904Z","avatar_url":"https://github.com/nrkno.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tumbleweed \n\nLogs detailed metrics about URLSession tasks to the console, such as DNS lookup durations, request and response times and more. Tumbleweed works by parsing the metrics collected by the `URLSessionTaskMetrics` introduced in iOS 10.0.\n\n## Example output\n\n```\nTask ID: 1 lifetime: 594.9ms redirects: 0\nGET https://github.com/ -\u003e 200 text/html, through network-load\nprotocol: http/1.1 proxy: false reusedconn: false\ndomain lookup     |#                                                                               |   3.0ms\nconnect           |###############################################                                 | 330.0ms\nsecure connection |               ################################                                 | 223.0ms\nrequest           |                                               #                                |   0.2ms\nserver            |                                               ###################              | 130.9ms\nresponse          |                                                                 ###############| 105.8ms\n                                                                                             total   575.0ms\n```\n\nA few notes on the data:\n* Task lifetime is the time of the URLSessionTask creation to the response is delivered.\n* The \"through\" key on the second line will tell you whether the response was fetched from cache, delivered by server push or by network load.\n* \"server\" is how long the server spent processing the request\n\n_Note_ that not all responses will deliver complete metrics, such as local cache fetches and other non-network loaded responses.\n\n## Usage\n\nIn your `URLSessionDelegate`:\n\n```swift\nfunc urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) {\n    let stats = SessionMetrics(source: metrics, task: task)\n    let renderer = ConsoleRenderer()\n    renderer.render(with: stats)\n}\n```\n\nAs a convenience Tumbleweed provides the `SessionMetricsLogger` which can be set as the `URLSessionDelegate` on `URLSession`, if you're not using any of the other delegates.\n\n```Swift\nlet sessionDelegate: URLSessionDelegate?\nif #available(iOS 10.0, *) {\nsessionDelegate = SessionMetricsLogger()\n} else {\n    sessionDelegate = nil\n}\nlet session = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil)\n```\n\n## Installation\n\nTumbleweed is available as a CocoaPod (`pod 'Tumbleweed'`) and the Swift Package Manager. Framework installation is also available by dragging the Tumbleweed.xcodeproj into your project or via Carthage.\n\nTumbleweed has no dependencies outside of Foundation.\n\n## License\n\nSee the LICENSE file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrkno%2Ftumbleweed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnrkno%2Ftumbleweed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrkno%2Ftumbleweed/lists"}