Search code examples
iosswiftprofilingrestkitanalytics

Monitor Network Calls IOS using Restkit


I am completely dependent on Rest Kit for my app for network calls. I want to see the logs of how much

  • 1) Time taken by each API to get a response
  • 2) Size of Request/Response Payload
  • 3) URL of the API

Is there any way I can enable such logging in Restkit. My app is calling like 50-60 API an dI don't want to dig into entire code base an add manual logs. Also I don't want to use network profiling tool since I will be tracking this data when an actual user is using the application. Cant also use any third party paid tool so want to log these values in application database.


Solution

  • RestKit does have a log you can enable, but that isn't what you want to do if you plan to actually release this. It also writes to the log, not a value you can actually process and save.

    Your likely best option is to subclass the RKObjectManager and intercept the requests that are being placed and the NSURLRequests which are being generated.