Use
From the CampaignDashboard folder, run the following command:
./dashboardCampagne -definition=[definition-file] -config=[congif-file] -screenshots=[screenshots-folder]
To generate the dashboard [screenshots-folder]
must be set but not necessarily with images (the scenario will be generated empty) There are example files for the definition file in example
. config.yml
must be filled with the token.
At the end of processing, the console outputs the details by step according to the versions. This can be used in Excel to display the comparison by step.
PDF export
If wkhtmltopdf
is installed, then a PDF export will be automatically generated from HTML file.
If ghostscript
is installed, then the PDF will be automatically compressed.
Definition
...
The Greenspector dashboard presents the results for better understanding. In particular, it calculates the Greenspector Ecoscore, a gobal score for the service measured.
It can also compare 2 versions of the same application, if the user path has the same number of steps and the same step names.
Configuration
The executable dashboardCampagne
needs config.yml
, definition.yml
and resources to generate the results dashboard. Resources include example
, i18n
, images
, site
et site_templates
. Check all these elements.
Download and place them in the folder where the
dashboardCampagne
and modify them using the following instructions:
Config file
Code Block | ||
---|---|---|
| ||
cfgs:
- name: "core-saas" # Instance name
url: "https://core-saas-prod.greenspector.com" # URL de l'instance
token: [MYTOKEN] # User Token |
Info |
---|
Replace |
Definition file
Definition of dashboard
First, we will define the global parameters of the dashboard to be generated: name, language, type of audit or units of measurement.
Code Block | ||||
---|---|---|---|---|
| ||||
################################################################################## # Dashboard definition ################################################################################## name: Application Measures # Report name env: app # Environment name to use (env. needsRelative to be defined in the config file) evolutiontype: comparaison # "comparaison" ouor "evolution" - Change lethe type des graphes de suivi des versions generationtype: # optional - define which generation type is expected by the DashboardCampagne. Possible values are "Scenarios" for scenario generation only, "Dashboard" for dashboard generation only and "All" (default) for both usembfordata: true # optional - replace kB unit to MB one. shouldgenerateevolutionperdomain: true # optional - show evolution per domain (default false) of graphs version generationtype: Dashboard # Optional - Default: "All" - "All", "Dashboard" or "Scenarios". Defines which files will be generated basenetworktype: WIFI # Optional - Default: "WIFI" - "WIFI", "4G", "3G" or "2G". The network used during the measurements usembfordata: false # Optional - Replace Kb par Mb shouldgenerateevolutionperdomain: false # Optional - Default: false - Display evolution by domain pausedurationtouseforconsumption: 30.0 # optionalOptional float64- - set the durationDefault: 30.0 - pause in seconds usedfor toa compute energy consumption and impact of pausesPAUSE step (default: is 30.0 seconds) language: # optional - define the language to use for exported files (among "FR" and "EN", default is "EN"). basenetworktype: # optional - the network to use for the whole document as a base. Default: WIFI version: 2.0 # optional - can be 1.0 or 2.0. Default: 2.0 web: true # optional - if measurements are web change thresholds for data consumptions - useful only version: 2.0. Default: false # Ajouter `comparisons` pour des comparaisons des métriques entre plusieurs plateformes sur le réseau WIFI comparisons: metrics: - Performance - Data - EnergySpeed - EnergyConsumption - Carbon audits: - name: [Nom de la série à afficher (exemple : "Samsung S7")] id: [ID de l'audit à récupérer (exemple : 78914)] device: [Nom du device à récupérer sur APP] network: [Réseau à utiliser ; optionnel ; valeur par défaut : WIFI] extramestime: [Temps ajouté à la fin des mesures de chargement à déduire des perf. - en secondes] datacsvfile: [optionnel (utile pour iOS uniquement) - Chemin vers un .csv qui contient les data au format US et trois colonnes "auditId,step,dataUsage (kB)"] - [...] auditids: - version: [Nom de la version à afficher] plateforme: [Nom de la plateforme à aller chercher sur App] os: [Nom de l'OS = Android ou iOS] idwifi: [id de l'audit WIFI] id4g: [id de l'audit 4G - optionnel, utilisé pour comparaison de réseau] id3g: [id de l'audit 3G - optionnel, utilisé pour comparaison de réseau] id2g: [id de l'audit 2G - optionnel, utilisé pour comparaison de réseau] extramestime: [Temps ajouté à la fin des mesures de chargement à déduire des perf. - en secondes] date: [Date de la mesure à afficher] datacsvfile: [optionnel (utile pour iOS uniquement) - Chemin vers un .csv qui contient les data au format US et trois colonnes "auditId,step,dataUsage (kB)"] filternetworkonversions: [optionnel - si 'true' filtre le réseau sur chaque version fournie (idwifi, id4g ...). Par exemple, uniquement les mesures WIFI seront récupérées sur la version de idwifi. Si la valeur est 'false', alors tous les réseaux sont récupérés sur la valeur fournie. Valeur par défaut = 'true'] |
This displays changes in metrics between versions. If this is not filled in, or only the idwifi
is filled in, there is no evolution curve.
In steps:
Code Block |
---|
- name: [Nom du step dans GSPT]
type : [Type d'étape]
energy: [A monitorer pour l’énergie - optionnel, dépend du type d'étape si pas de valeur saisie]
data: [A monitorer pour la data - optionnel, dépend du type d'étape si pas de valeur saisie]
performance: [A monitorer pour la perf - optionnel, dépend du type d'étape si pas de valeur saisie]
domain: [Domaine à associer]
order: [Ordre pour la génération du scénario]
displayname: [Nom du step à afficher dans le rapport] (optionnel, si ajouté alors ce nom remplace le champs name qui correspond à la mesure)
critical: [Est une étape critique du parcours fonctionnel] (optionnel, Par défaut false) |
Les types d'étape
The different types of steps are as follows:
UserAction (action or scrolling on the screen)
Loading (loading a screen)
Pause (pause on a screen)
Depending on the type of step, the severity of the ratings may differ. The type of stage is also useful for calculating different averages.
For example
UserAction steps are rated less severely on performance
Pause steps are not taken into account when calculating performance by default.
If the name of the step respects the following naming, then its type will be assigned automatically. It can always be overridden by defining the type option:
PAUSE_<step_name>: assigned as type Pause
ACTION_<step_name>: assigned as a UserAction type
SCROLL_<step_name> : assigned as type UserAction
CHRGT_<step_name>: assigned as a Loading type
Environmental assessment
An environmental assessment can be carried out using dashboard data and the co2-algorithm-service by adding a parameter environmentalinput
:
Code Block | ||
---|---|---|
| ||
environmentalinput:
useroptions:
userlocations:
france: 97 # % users in france
world: 3 # % users in another part of the world (not in France)
usertypes:
smartphone: 55 # % users on smartphone
tablet: 1 # % users on tablet
pc: 44 # % users on PC
networkoptions:
networklocations:
france: 97 # % users in france
world: 3 # % users in another part of the world (not in France)
networktypes:
gsm2g3g: 25 # % users in 2G/3G
gsm4g5g: 25 # % users in 4G/5G
wiredfibre: 25 # % users in fiber
wiredxdsl: 25 # % users in adsl/xdsl
serveroptions:
serverlocations:
france: 100 # % server in France
world: 0 # % server in another part of the world (not in France)
servertypes:
complexserver: 100 # % complex server
simpleserver: 0 # % simple server
# parameters: # optional
# pue: 1.5 # [optional - data center PUE, minimum 1.0]
# datainput: # optional
# reqnetwork: 200 # [optional - number of http requests. (if non specified, it is deducted from the number of data exchanged on network during the scenario] |
Proxy configuration
It is possible to use a proxy to realize the various requests. By default, the tool will try to retrieve information about the proxy from the environment variables. On Windows and Mac there are other ways of configuring the proxy which are also retrieved (e.g. PAC autoconfiguration file, etc.). To find out which methods are supported, go here : Proxy auto-configuration methods.
However, there is a manual method of configuring the proxy. Simply add to the config.yml
:
Code Block |
---|
proxy: http: http://monproxy.local:8080 # Proxy pour les URL en http https: http://monproxy.local:8080 # Proxy pour les URL en https EN # Optional - Report language: "FR" (default) or "EN" version: 2.0 # Optional - Default: 2.0 - "1.0" or "2.0" or "2.1" web: true # Optional - Default: false. For web measurements, enter true to change the data consumption thresholds |
Measures
The second part links the generation of the dashboard with the measurements stored in the Workshop:
Code Block | ||||
---|---|---|---|---|
| ||||
##################################################################################
# Measurement campaign used to calculate the Ecoscore
##################################################################################
auditids:
- version: v1.0.0 # Version name to display
plateforme: Galaxy S9 # Name of the platform displayed in Core SaaS Greenspector
os: Android # "Android" or "iOS"
idwifi: [MYIDWIFI] # WIFI audit ID
id4g: # Optional - 4G audit ID to compare network measurements (or id3g for 3G measurements)
extramestime: 1.0 # float64 - Time in seconds added at the end of the loading steps. This time is not taken into account for the performance metric.
date: 07/12/2023 # Measurement date to display |
Info |
---|
Replace |
To identify MYIDWIFI
, go on the Workshop. Select the correct version from the list and copy the second number into the URL. This is the audit ID.
...
Environmental impact
As well as grouping and presenting the results, the dashboard provides a projection of the environmental impact. In this section, specify the parameters to obtain an accurate projection using our Greenspector impact model.
Code Block | ||||
---|---|---|---|---|
| ||||
##################################################################################
# Environmental impact parameters (optional)
##################################################################################
environmentalinput:
useroptions:
userlocations:
france: 20 # users in France
world: 80 # users in World (except France)
usertypes:
smartphone: 50 # users on smartphone
tablet: 30 # users on tablet
pc: 20 # users on PC
networkoptions:
networklocations:
france: 20 # users in France
world: 80 # users in World (except France)
networktypes:
gsm2g3g: 4 # users in 2G/3G
gsm4g5g: 15 # users in 4G/5G
wiredfibre: 39 # users in fibre
wiredxdsl: 42 # users in adsl/xdsl
serveroptions:
serverlocations:
france: 20 # server in France
world: 80 # server in world (except France)
servertypes:
complexserver: 70 # complex server
simpleserver: 30 # simple server |
Note |
---|
The sum of each distribution must equal 100. |
The server type parameter (servertypes
) is used to estimate the server impact.
Simple server allows you to model infrastructures with a maximum of 2 VMs or containers (e.g. a front and a backend), not including third-party services.
For example : a VM for the front and another for the backend.
Complex server is used to model the rest.
Complex server is therefore set to 100% if the infrastructure has more than 2 VMs/containers.
Comparisons step by step
This part is only used to compare two versions of the same application.
Code Block | ||||
---|---|---|---|---|
| ||||
##################################################################################
# Comparisons step by step with another measurement campaign (optional)
##################################################################################
comparisons: # Used to compare all steps with each other
metrics: # Metrics used for comparison
- Performance
- Data
- EnergySpeed
- EnergyConsumption
- Carbon
audits:
- name: S9 # Name of the series to display
id: 12345 # Audit id
device: Galaxy S9 # Device name
network: WIFI # Optional - "WIFI"(default), "4G", "3G" ou "2G"
extramestime: 1.0 # Time added at the end of loading steps. This time is not taken into account for the performance metric
- [...] |
The group metrics
lists the metrics on which versions of the same application will be compared. Comment out the metrics whose comparison does not need to be displayed in the dashboard.
The group audits
includes all the versions to be compared.
Definition of steps
This last mandatory part defines which steps will be analysed.
Code Block | ||||
---|---|---|---|---|
| ||||
##################################################################################
# Definition of steps
##################################################################################
refname: "PAUSE_reference"
steps:
- name: "PAUSE_reference"
domain: Tech
- name: "CHRGT_home"
domain: Home
- name: "PAUSE_home"
domain: Home
- name: "CHRGT_cookies"
domain: Home
# type: action # Optional - Type of step. If not specified, the value depends on the acronym of the stage name.
# energy: true # Optional - Step to use for energy. If not specified, the value depends on the type of step.
# data: true # Optional - Step to be used for data. If not specified, the value depends on the type of step.
# performance: true # Optional - Step to use for performance. If not specified, the value depends on the type of step.
# order: 1 # Optional - Order used for the scenario report.
# displayname: # Optional - Name to be displayed in the report instead of the measurement name
# critical: false # Optional - Default: false. Can define the step as critical for the functional path. |
For each step, detail which metrics need to be taken into account or whether this step is critical. For a clear dashboard, a more legible step name can be used.
Info |
---|
As seen in 06 - Discover GDSL test language, the steps are divided into 4 categories: CHRGT, PAUSE, ACTION, SCROLL, respectively for a load, a pause, an action and a scroll. PAUSE steps are not taken into account in performance because they have a fixed duration. |
Generate a dashboard
To generate a dashboard, run the following command:
Windows - Linux - MacOS:
Code Block | ||
---|---|---|
| ||
dashboardcampagne -config=config.yml -definition=definition.yml -screenshots=screenshots |
The web browser will open and display the dashboard in .html
.
In addition, a .pdf
file is only generated on Linux.
Note |
---|
Even if the dashboardcampaign is not failing, be sure to check the logs. Non-fatal errors can occur. |
...
In addition to the results dashboard, a second file with before and after screenshots is also generated in HTML and PDF format. Add the argument -screenshots=screenshots
to the command dashboardCampaign
to have this functionality.
...
PDF export
If wkhtmltopdf
is installed, a PDF export will be automatically generated from the HTML file.
If ghostscript
is installed, the pdf will be automatically compressed.