Developers

Codavel Performance Service (Beta)

Requirements

Mobile

Android

  • Minimum SDK version: 16

iOS

  • Minimum SDK version: 9.0 or higher

Enabling Bolina

2. Login

a. If you do not have access, please contact our sales team, they will give you access to the console

3. Add a new app

a. Go to home and click “New App”

b. Create a new app

 

      1. Give the app a name
      2. Add the package name of your app 
      3. Select the app type: CDN to use the bolina as a service, on-premise to use bolina on your
      4. infrastructure. Note: To use bolina on premise, please contact us before to get binaries and the instructions to deploy it.
      5. Select the regions where you want the bolina service enabled
      6. Click in the button “Create App”

c. Your new app will appear in the list of deployments with the creation status “Processing (Creating deployment…)”. This will take some time, you will receive an email notification when the deployment is ready to use.

4. The deployment is ready to use when the Creation status change to “Deployment ready” and the Bolina server URL is available

5. Click the (?) button in your deployment

6. This will guide you through the steps to add the SDK to your app with the commands properly configured to your app. You just need to:

a. Select the operating system of your app

b. Follow the steps to add the Bolina SDK to your app. Just copy and paste the code to your app

We have detailed instructions to the most common HTTP clients in the market. You just need to copy and paste the code to your app.

 

If you have any questions, please contact support via https://private.codavel.com/help-support/support 

SDK Configuration Instructions

→ Android

To add the Bolina Client SDK repository to your project, simply open the app build.gradle and add the following line:

allprojects {
  repositories {
    ...
    maven { url "https://artifact.codavel.com:8081/artifactory/android" }
    ...
  }
}

Select the HTTP Client you are using:

OkHttp v3.0+

Add the Bolina Client SDK as dependencies of the project and add the app id and app secret to the app’s build.gradle script:

android {
  defaultConfig {
    ...
    resValue "string", "BOLINA_DEPLOY_ID", "<APP_ID>"
    resValue "string", "BOLINA_SECRET_ID", "<API_KEY>"
    ...
  }
}
dependencies {
  ...
  implementation 'com.codavel.bolina:interceptor_okhttp3:0.9.59'
  ...
}

Enable the Bolina SDK on the app after creating the OKHTTP client:

import com.codavel.bolina.interceptor.okhttp3.CvlOkHttp3;
...
OkHttpClient client = new OkHttpClient.Builder()
  .addInterceptor(new CvlOkHttp3Interceptor())
  .build();
...

Make sure that before performing HTTP requests you import and start the interceptor:

// 1) import Bolina interceptor
import com.codavel.bolina.interceptor.okhttp3.InterceptorSingleton;
...
// 2) initialize the Bolina Configuration
BolinaConfiguration config = new BolinaConfiguration();
// 3) set the Bolina Configuration domain name
config.setDomainName("<BOLINA_SERVER_URL>");
// 4) start the Bolina interceptor
InterceptorSingleton.startInterceptor(getApplicationContext(), config);
...

You should also stop the interceptor whenever you don’t need it, by running:

...
InterceptorSingleton.getInstance.stopInterceptor();
...

OkHttp v2.7+

Add the Bolina Client SDK as dependencies of the project and add the app id and app secret to the app’s build.gradle script:

android {
  defaultConfig {
    ...
    resValue "string", "BOLINA_DEPLOY_ID", "<APP_ID>"
    resValue "string", "BOLINA_SECRET_ID", "<API_KEY>"
    ...
  }
}
dependencies {
  ...
  implementation 'com.codavel.bolina:interceptor_okhttp2:0.9.59'
  ...
}

Enable the Bolina SDK on the app after creating the OKHTTP client:

import com.codavel.bolina.interceptor.okhttp2.CvlOkHttp2Interceptor;
...
OkHttpClient client = new OkHttpClient();
client.interceptors().add(newCvlOkHttp2Interceptor();
...

Make sure that before performing HTTP requests you import and start the interceptor:

// 1) import Bolina interceptor
import com.codavel.bolina.interceptor.okhttp2.InterceptorSingleton;
...
// 2) initialize the Bolina Configuration
BolinaConfiguration config = new BolinaConfiguration();
// 3) set the Bolina Configuration domain name
config.setDomainName("<BOLINA_SERVER_URL>");
// 4) start the Bolina interceptor
InterceptorSingleton.startInterceptor(getApplicationContext(), config);
...

You should also stop the interceptor whenever you don’t need it, by running:

...
InterceptorSingleton.getInstance.stopInterceptor();
...

HTTPURLConnection

Notice, Bolina interceptor for HTTPURLConnection currently only supports HTTP requests. HTTPS requests will be supported in the future.

 

Add the Bolina Client SDK as dependencies of the project and add the app id and app secret to the app’s build.gradle script:

android {
  defaultConfig {
    ...
    resValue "string", "BOLINA_DEPLOY_ID", "<APP_ID>"
    resValue "string", "BOLINA_SECRET_ID", "<API_KEY>"
    ...
  }
}
dependencies {
  ...
  implementation 'com.codavel.bolina:interceptor_urlconn:0.9.59'
  ...
}

Enable the Bolina SDK on the app after creating the OKHTTP client:

// 1) import Bolina interceptor
import com.codavel.bolina.interceptor.urlconn.InterceptorSingleton;
...
// 2) initialize the Bolina Configuration
BolinaConfiguration config = new BolinaConfiguration();
// 3) set the Bolina Configuration domain name
config.setDomainName("<BOLINA_SERVER_URL>");
// 4) start the Bolina interceptor
InterceptorSingleton.startInterceptor(config);
...

You should also stop the interceptor whenever you don’t need it, by running:

...
InterceptorSingleton.getInstance.stopInterceptor();
...

→ iOS

Alamofire (Coming soon)

AFNetworking (Coming soon)

NSURLConnection (Coming soon)

Insights

1. Go to the performance section of the menu

2. There are two dashboards available:

a. The network dashboard – With request information and more detailed and low-level statistics

b. The user dashboard – With action information and user behavior. Note: To view data in this dashboard you need to add action data via SDK. Please see the section Configure Action in App

3. Both dashboards allow filters, please use the respective sections to set the filters

 

Available data points:
Note: Actions = Set of requests

 

User-level:

 

  • Cumulative distribution function – Bolina vs HTTP
  • Plot actions over time
  • Number of users, number of devices, number of actions
  • Action duration (Median avg. p75, p90, p99)
  • Users location (Geo IP based)
  • % actions – HTTP vs Bolina
  • Actions distribution – WiFi vs Cellular
  • OS Version
  • Device Model
  • Network carrier (Cellular)
  • WiFi network name and frequency (2.4 or 5)

 

Network-level:

 

  • Number of devices
  • Number of users
  • Number of requests
  • Requests over time
  • % cache hit Bolina and CDN
  • Users location – Country level
  • % requests – Bolina vs HTTP
  • OS version distribution
  • % requests – WiFi vs Cellular
  • Device model
  • Network carrier (Cellular)
  • WiFi network name and frequency (2.4 or 5)
  • Request time (avg. p50, p75, p90, p99)
  • Total of bytes transferred (Bolina and HTTP)
  • Top 10 requests (More frequent)
  • Top 10 requests with errors
  • Top 10 slowest requests
  • Top 10 biggest requests

Confirgure actions in App

Bolina 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 Bolina Performance Console. 

Bolina 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

 

String action_id = InterceptorSingleton.getInstance().startAction(“open app”, (bolina ? "BOLINA" : "HTTP"));

2. When you want to mark the stop of the same action, add the following line to your code:

 


InterceptorSingleton.getInstance().stopAction(action_id);

3. When you want to add metadata to the action, add the following lines to your code:

 

JSONObject metadata = new JSONObject();

metadata.put(“test”,”testing-metadata”);

metadata.put(“test_int”,123);
InterceptorSingleton.getInstance().addActionMetadata(action_id,metadata);

4. When you finish collecting data to the action, add the following line to your code:

 

InterceptorSingleton.getInstance().processAction(action_id);

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 start playing
  3. Call processAction to save the action
  4. Go to Insights -> User in the Bolina Performance Console
  5. This dashboard aggregates all the actions, if you only want to see one action, please use the filters to select your action name

Bolina 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 Bolina Performance Console. 

Bolina 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

 

String action_id = InterceptorSingleton.getInstance().startAction(“open app”, (bolina ? "BOLINA" : "HTTP"));


2. When you want to mark the stop of the same action, add the following line to your code:

 


InterceptorSingleton.getInstance().stopAction(action_id);


3. When you want to add metadata to the action, add the following lines to your code:

 

JSONObject metadata = new JSONObject();

metadata.put(“test”,”testing-metadata”);

metadata.put(“test_int”,123);
InterceptorSingleton.getInstance().addActionMetadata(action_id,metadata);


4. When you finish collecting data to the action, add the following line to your code:

 

InterceptorSingleton.getInstance().processAction(action_id);


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 start playing
  3. Call processAction to save the action
  4. Go to Insights -> User in the Bolina Performance Console
  5. This dashboard aggregates all the actions, if you only want to see one action, please use the filters to select your action name

Advanced Configurations

Bolina SDK allows the configuration of some advanced settings useful to fine tune your users experience. Please, before changing these settings make sure you know what you are doing. All the methods below are accessible via the BolinaConfiguration object that you need to pass to InterceptorSingleton.startInterceptor()


App settings

  • setConfigFolder(String configFolder)- Sets the path used by bolina core to store cached info. Default:

Verbose settings

  • setVerboseLevel(String verboseLevel) – Changes the verbose level of bolina client. Accepted values: “critical”(less logs), “info”, “debug”, “trace”(more logs). Default: critical

Protocol settings

  • setBolinaHandlerPattern(Pattern bolinaHandlerPattern) – Sets the URLs to be accelerated via bolina. Any URL that match this pattern will use bolina, on the other hand, a URL that does not match this pattern will be transferred using regular HTTP. default: Pattern.compile(“.*”), meaning all requests are accelerated
  • setCertsEnabled(boolean enableCerts) – Enables/Disable the use of SSL certificates. Default: true.
  • setAllowSelfSignedCerts(boolean allowSelfSignedCerts) – Enables/Disable the use of self signed SSL certificates. We strongly recommend the use of this option only for testing purposes. Default: false.
  • setMaxMemoryAllowed(long maxMemoryAllowed) – Sets the maximum amount of memory used by bolina core. Default: 10MB
  • setZeroRtt(boolean enableZeroRtt) – Enables or disables the use of 0-RTT in Bolina. Default: enabled
  • setTimeToKeepAlive(int timeToKeepAlive) – Sets the time to keep connection idle in milliseconds. Default: 120s

Insights settings

  • setMonitorPercentage(int monitorPercentage) – Sets the percentage of requests to be traced for detailed statistics in the insights dashboard. A value of 100 means all requests appear in the dashboard. Default: 100