Android: Minimum SDK version: 16
Before deploying all the necessary components to enable the Codavel Performance Service, an App must be configured in Codavel’s private area. In case you have already configured your App, you may skip this section. Otherwise, please follow these steps:the deployment id and the deployment secret
1. Login into https://private.codavel.com/
a. If you do not have access, please contact your dedicated account manager, he will give you access to the console.
2. Add a new app
a. Go to Home and click “NEW APP”
b. Fill in the fields, namely
1. Give the app a name (descriptive)
2. Add the package name (Android) and/or bundle identifier (iOS) of your app. If it doesn’t match with your app, the traffic will be discarded.
3. Choose the App Type on-premises to use bolina on your own infrastructureChoose the App Type CDN to use Codavel Performance Service.
4. Click in the button CREATE APP
3. The deployment is ready to use. The creation status should say Deployment ready, and you should receive an email notification shortly
4. Click the app info button (?) to see the deployment id and the deployment secret
5. Take note of both deployment id and secret, you will need them later.
In order to integrate Bolina with Retrofit, we recommend using OKHTTP as the HTTP engine.
The integration can be achieved by following this instructions:
1. To add the Bolina Client SDK repository to your project, simply open the app or module's build.gradle and add the following block of code:
2. Add the Bolina Client SDK and OkHTTP client as dependencies of the project and add the app id and app secret to the app’s build.gradle script:
The most recent version, is available in the private area, inside instructions
3. To enable all functionalities of Codavel’s monitoring solution, Bolina has the following dependencies:
a. In case you have not migrated your app to androidx library artifacts, include the Work Manager by adding the following block of code to the app’s build.gradle script:
Additionally, add the following lines to your gradle.properties file:
b. Bolina also requires the following permissions, that should be added to your app’s manifest:
4. Make sure that, before performing any HTTP request, you import and start the interceptor:
a. Import Bolina interceptor
b. Initialize the Bolina Configuration and set the Bolina Configuration domain name:
c. [optional] Configure your Origin:
With this configuration, all requests intercepted by Bolina that would originally be sent to <your.cdn.com>, will be sent to a Bolina Server, that then will fetch the resource from <your.origin.com>. In case the Bolina transfer fails, the requests will be sent to <your.cdn.com>, as before. You can add multiple entries to be replaced. Otherwise, without this configuration, Codavel Performance Service servers will perform the same request as your HTTP clients would, to your current CDN or Origin.
d. Start the Bolina interceptor:
e. Create an OkHttpClient with Bolina Interceptor (other options are available in Other Options to Integrate):
f. Add the OkHttpClient to Retrofit
g. Make sure you stop the interceptor whenever you don’t need it:
Other Options to Integrate:
i. Use a OkHTTP client created and managed by Bolina
ii. Register Bolina interceptor into your OkHTTP client:
iii. Manually add our interceptor into your OkHTTP client, along with Codavel’s network event listener to enable our monitoring solution:
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
2. When you want to mark the stop of the same action, add the following line to your code:
3. When you want to add metadata to the action, add the following lines to your code:
4. When you finish collecting data to the action, add the following line to your code:
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
Bolina SDK allows the configuration of some advanced settings for enabling some features, configuring security options and increasing the debug level. 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()
A/B Testing setting
Here you will find all the necessary instructions to deploy all the server infrastructure required to run Codavel Performance Service, while giving a brief overview of the system architecture and behavior.
The Codavel Performance Service is a service that improves content delivery for mobile apps, presenting robustness against latency and packet loss, regardless of the user’s network, device, location, or time.
Regarding its architecture, it is composed by multiple entities, each one with its own responsibility:
The following instructions will deploy all the necessary components to enable the Codavel Performance Service, and must be followed in this order:
1. Download installation project
In order to access all the configuration files necessary for the deployment, enter the following command in a machine with access to the kubernetes cluster through kubectl.
The management component of Bolina is composed of two different services:
Control: Receives information from all the running Bolina core instances and aggregates that data into storage. It is based on Consul, and of a cluster of three Consul instances, each one deployed as a replica of a kubernetes statefulset and running in different kubernetes nodes. Every time that a Bolina core instance changes its availability, or the number of instances running changes, it propagates the information to the Scaling service and to the Service Discovery component, if enabled.
Scaling: Watches the control service for any update, and based on the number of running Bolina core instances and its availability, scales the number of machines if necessary to ensure that the percentage of available instances is always above a certain threshold.
To provide access to Consul’s statefulset by the other components, we deploy a kubernetes service that redirects the traffic on the following ports to one Consul running node:
To deploy the Bolina Management component follow these steps:
3. Bolina Core
The Bolina Core is deployed as a kubernetes deployment, where the number of replicas is controlled by the Scaling component, based on the system usage.
Each instance of Bolina core is represented by a kubernetes pod, and must have internet access and to be accessed directly (on port 9001/tcp and 9002/udp) through Bolina Shield (if enabled) or Bolina SDK. In order to achieve this, each pod runs on a different kubernetes node, using hostPort to expose the following ports on the node that hosts the containers:
The steps to create the deployment for the Bolina Core are the following:
4. [optional] Service Discovery
The information regarding the available Bolina instances can be obtained by using our Service Discovery component. This entity parses the information obtained from our management component and propagates that information to a configurable HTTP endpoint each time there is an update on the number of instances running or its availability.
If you wish to enable this component, follow this instructions:
For each update, the configured endpoint will receive a POST message containing a JSON message composed by an array of Bolina Endpoints. Each value represents an available connection to a Bolina core endpoint, and has the following information:
Below is an example for two Bolina endpoints, available at the IP address 18.104.22.168 and 22.214.171.124. listening for UDP on port 9002, listening for TCP on port 9001 and with the ID -805390934 and 202130133, respectively:
To get more information about your deployment and the users connected through Codavel Performance Service, we provide an analytics page inside your Codavel account, with data collected from both Servers and Client’s SDKs.
In order to access it, please follow these steps:
1. Login into https://private.codavel.com/
a. If you do not have access, please contact our sales team, they will give you access to the console.
2. Go to the Insights section of the menu.
a. Network – Contains overall HTTP requests information, along with some more detailed and low level statistics.
b. User – Contains action information and user behaviour. Note: To view data in this dashboard you need to add action data via SDK. Please see the section Configure Action in App of the respective interceptor.
c. Debug – Contains detailed information about possible errors that may affect your user experience, that can be used to identify and fix any configuration or deployment issues.