# Configure Actions

Codavel SDK can collect the performance data between two points in your app code. This way you can easily compare the network performance of your app's requests with and without Bolina in a dashboard in your Codavel Performance Console. Codavel SDK provides methods to start, stop and add additional metadata to an action:

  1. When you want to mark the start of an action, add the following line to your code:
  • Swift
  • Objective-C
let actionID = BolinaInterceptor.startAction("Startup", withProtocol: "BOLINA")
1
  1. When you want to mark the stop of the same action, add the following line to your code:
  • Swift
  • Objective-C
BolinaInterceptor.stopAction(actionID)
1
  1. When you want to add metadata to the action, add the following lines to your code: (This data can be anything you wish as long as it is a Dictionary)
  • Swift
  • Objective-C
let metadata:[String:Any] = ["MetadataKey-1":status, "MetadataKey-2":String(duration), ...]
let metadataDictionary = NSMutableDictionary(dictionary: metadata)
BolinaInterceptor.addActionMetadata(actionID, withMetadata: metadataDictionary)
1
2
3
  1. When you finish collecting data to the action, add the following line to your code
  • Swift
  • Objective-C
BolinaInterceptor.processAction(actionID))
1

# Example

Trace the time to start a video:

  1. Call startAction when the user press the play button and give it a name, e.g. video start
  2. Call stopAction when the video starts playing
  3. Call processAction to save the action and send the action stats to your dashboard