Latest 0.1.0
Homepage https://github.com/dmiedema/URLSessionMetrics
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Simple drop in and go. Displaying and viewing the request metrics is already handled

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 3.

For Swift 4 see the Swift4 branch

Installation

URLSessionMetrics is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "URLSessionMetrics"

OR

Drag URLSessionMetrics/Classes folder into your project and add files.

Setup

Make sure your Network calls library conforms to the URLSessionTaskDelegate.

Inform the shared MetricsManager that metrics were collected

extension RequestManager: URLSessionTaskDelegate {
    public func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) {
        MetricsManager.shared.add(entry: metrics)
    }
}
@interface NetworkingManager() 
#ifdef __IPHONE_10_0
<NSURLSessionTaskDelegate>
#endif
... [other code] ...
@end

@implementation NetworkingManager
...
#ifdef __IPHONE_10_0
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics {
    [[MetricsManager shared] addWithEntry:metrics];
}
#endif

Author

dmiedema, [email protected]

License

URLSessionMetrics is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "URLSessionMetrics",
    "version": "0.1.0",
    "summary": "URLSessionMetrics Browser and Detail Viewer",
    "description": "Logger and Viewer for URLSessionMetrics added back in iOS 10.nDesigned to be easy to drop in and go with the easiest setup possible.",
    "homepage": "https://github.com/dmiedema/URLSessionMetrics",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "dmiedema": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dmiedema/URLSessionMetrics.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/no_good_ones",
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "URLSessionMetrics/Classes/**/*",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This