You are viewing our old blog site. For latest posts, please visit us at the new space. Follow our publication there to stay updated with tech articles, tutorials, events & more.

Benchmarking of iOS Applications with AppTracer Framework

0.00 avg. rating (0% score) - 0 votes

In Naukri, we always keep striving that our products keep high value in the terms of quality. High quality is the only key to make the business sustain.
For ensuring the high quality of the product, we follow many benchmarking procedure. One of them is the AppTracer Framework.

Following are some of the metrics that plays an important role to achieve the high quality:

  • Application load time.
  • API response time on different type of network like 2G, 3G, etc.
  • Views render time after getting the response from API.
  • Exception & crashes

AppTracer framework provides a benchmarking report for all these metrics in the form of console log and text file. We have built this iOS framework and it’s very easy to use.

Overview

 

1

How it works?

Benchmarking through AppTracer framework is done in the following steps.

  1. Whenever any API request is made by application, we set the hit time t1.
  2. In the success response of the API, we set the hit time t2.
  3. Calculate the difference (t2-t1) and show it to the debug console of the Developer along with the API request made and the response received.
  4. Also, we log the same response in text file in the app directory, which can be later on used for the purpose of benchmarking of the API.
  5. If the API has some exception/error in response then we show it to the debug console and also log the same in the text file at app directory.
  6. Similarly, when we load the screen after getting api response then we put the time stamp t3 and the difference of (t3-t1) will be treated as page load time.

Implementation:

The AppTracer framework implementation is quite simple.

Following are the steps for implementation:

  1. Drag and drop the AppTracer framework in the project framework folder.
  2. Add the following lines in AppDelegate’s didFinishLaunchingWithOptions:

       Untitled

3.  Now you can use the following methods defined in AppTracer.h

       Untitled2

For tracing the API, you need to create the TracerAPIModel and pass it whenever the API request is made.

For tracing the page Load time, we need to pass a unique page identifier. When the page starts loading then call the traceStartTime: selector with the unique page-id. When the page load is finished then call the traceEndTime: selector with the same page-id. It will log the time difference of these loggings for that page in the text file.

Similarly, you can log the crashes and exception in the text file by creating the TracerExceptionModel object and passing it to the traceExceptionsAndCrashes: selector.

Results:

  1.  Using the tracer, you will be getting the logs displayed on the debug console of the Xcode:  Untitled3Untitled4
  2.  We can also get the text file of these logs from the document directory of the application.

Untitled5

3.  These logs gives us the application page load time as well as the API response time                     which can be used for benchmarking of the application.

Untitled6

Advantages that we got using this framework:

There are several advantages of using this framework:

  1. The main advantage of using this framework is it saves the manual effort of calculating page load time.
  2. Since the reading is made each time the page is accessed, we get more spread out average of the page load time instead of one or two manual reading.
  3. These files can be parsed to calculate the average and median page load times automatically, with separate readings for Wi-Fi /cellular network.
  4. It provides more accurate results as compared to manual calculation of load time.
  5. It also provides the debug exception / API error in the log files for developer which can be later on used by developer for quick debugging of the code. So it saves the precious time of developer while debugging any error.

 

Posted in Mobile