# 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 the app requests with and without Bolina in a dashboard in your Codavel Performance Console. Codavel SDK provides a method to start the trace of an action, another one to stop the trace, and another one to add optional metadata.

  1. When you want to mark the start of an action, add the following line to your code
  • Java
  • Kotlin
String action_id = InterceptorSingleton.startAction("open app", InterceptorSingleton.getInstance().currentProtocol());
1
  1. When you want to mark the stop of the same action, add the following line to your code
  • Java
  • Kotlin
InterceptorSingleton.stopAction(action_id);
1
  1. When you want to add metadata to the action, add the following lines to your code
  • Java
  • Kotlin
JSONObject metadata = new JSONObject();
try {
    metadata.put("test", "testing-metadata");
    metadata.put("test_int", 123);
} catch (JSONException ex) {
    ex.printStackTrace();
}
InterceptorSingleton.addActionMetadata(action_id, metadata);
1
2
3
4
5
6
7
8
  1. When you finish collecting data to the action, add the following line to your code
  • Java
  • Kotlin
InterceptorSingleton.processAction(action_id);
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