This repository contains the replication package of my thesis called The Impact of Resource Preloading and Resource Hints on theEnergy Consumption and Performance of Mobile Web Apps.
The repository contains all material required for the replication of the two conducted experiments:
- All subjects and the scripts used during their selection process.
- Our measurement infrastructure consisting of mitmproxy and a slightly modified version of the Android Runner framework.
- All the raw data collected during the execution of the experiments.
- The R notebooks for exploring, summarizing, and analyzing measurement data.
A high level overview of this repository's structure is shown below.
├── android-runner Source code of the Android Runner framework.
├── preloads Contains all resources needed for the preload experiment.
│ ├── AR_config_preloads.json AR config file used for this experiment.
│ ├── data_analysis R scripts and plots used during the data analysis
│ ├── mitmproxy Our mitmproxy plugin, the used config and all prerecorded responses.
│ └── raw_data Raw data of the experiment
├── resource_hints Contains all resources needed for the resource hints experiment
│ ├── AR_config_resource_hints.json AR config file used for this experiment
│ ├── data_analysis R scripts and plots used during the data analysis
│ ├── mitmproxy Our mitmproxy plugin, the used config and all prerecorded responses.
│ └── raw_data Raw data of this experiment
└── subject_selection All scripts used during our subject selection process.
├── scraper Scraper used to mine 3K websites meeting our criteria.
└── selection
├── preloads Subjects used for the preload experiment.
└── resource_hints Subjects used for the resource hints experiment.
Our measurement infrastructure is shown below and consists of three components: a mobile device, a RPi and the Monsoon HVPM.
- Download and install mitmproxy from here.
- Configure mitmproxy on your mobile device by installing the required certificate and as shown here. Android requires you to set a lock-screen PIN to add a certificate. Based on your device's resolution and chosen pin you might have to change the
android-runner/examples/monsoon/scripts/after_run.pyscript accordingly. - Download the recorded flows from the URLs provided in the .txt files.
- Make sure mitmproxy uses the correct configuration file. Copy
config_preloads.yamlorconfig_hints.yamlto~/.mitmproxyand rename it to config.yaml. - Start mitmproxy with our plugin by running
mitmdump -s preloads_plugin.pyormitmproxy -s resource_hints_plugin.py. Please note that we are using mitmdump instead of mitmproxy!
- Setup a Python virtual environment using
python3 -m venv .venvand install the required dependencies for Android Runner as described here. - Setup the Monsoon HVPM following the guide here. Make sure you install the original PyMonsoon package instead of this forked version.
- Start the experiment by running
sudo .venv/bin/python __main__.py AR_config_preloads.jsonorsudo .venv/bin/python __main__.py AR_config_resource_hints.json. Running the commands withsudois only required if you are using the Monsoon HVPM.
