Benchmark an application on the Power Test Cloud

Reading Time: 3 minutes

This article is part of a tutorial series that will explain different measurements’ use cases

Some indications are needed to start a good energy and ressource measure with GREENSPECTOR. Three notions must be taken into account: where will the tests be run (WHERE), what tests am I going to run (WHAT) et how am I going to run these tests (HOW).

Several ways to launch these tests (HOW) are available:

  • From the GREENSPECTOR web interface
  • From the command line with the Test Runner
  • From the command line with the CLI
  • Manually with the Free Runner Test
  • From the Jenkins Plugin

Benchmark an application on the Power Test Cloud

The easiest way to get started is to use an available smartphone from the Power Test Cloud (WHERE) and launch a benchmark test (WHAT). The advantage of the test bench is to have a device immediately available and configured, which allows you to obtain very stable measurements. Depending on your GREENSPECTOR license, it is possible that the test bench is installed within your premises (and not in the cloud). The benchmark makes it possible to simulate the application in different states (launching, inactivity, setting in background task…). To run the tests, we will use the CLI</ span> on an application.**

1) From the GREENSPECTOR interface, create a MyFirstApp app with version 1

2) Get your app as an APK or download one from a site like Apkpure

3) Download the CLI on your platform and put it in a directory. You can rename the file (e.g. gspt)

4) You can put the path of CLI in your path to simplify the launch

5) Open the command line in the directory where the application is located and launch the command

gspt init

The command prompt asks you for the token. You will find it in your preferences within the GREENSPECTOR interface.

6) Launch the command line that initializes a GREENSPECTOR local project

gspt ipc initprojectconfiguration --application MyFirstApp --version 1

7) Launch the following command to choose a smartphone

gspt testbench set-environment

8) Launch the benchmark with the following command:

gspt testbench benchmark-apk --apkFiles Instagram_v33.0.0.11.92_apkpure.com.apk  --iterations 3

9) You can see the progress from the GREENSPECTOR interface in jobs

10) When the job is finished, you can see the results:

Tips : Each time you use the CLI, you can add –help for options. To make the input faster, you can use the command alias (-a instead of –application for example)

Discover soon our others tutorials :