- Alberto Isotti
- Eoan O'Dea
- Dario Di Mambro
- Saman Khodadadi
- Hugo van Wezenbeek
The purpose of this project is to examine the relationship between Google's Core Web Vitals metrics and energy consumption on a Google Pixel 6.
An in-depth description of this experiment can be found in the research paper written for this assignment for the Green Lab module at Vrije Universiteit Amsterdam.
The code for this project is broken into 5 parts:
- data: The data that was collected during the experiment. It contains the Tranco top 1000 websites and a Python script that sorts through the websites, pings them and creates a list of the top 50.
- android-runner: A modified version of the Android Runner system built by the S2 Group at Vrije Universitiet Amsterdam, which is used to run the experiment.
- proxy: A mitmproxy script that is used to inject JavaScript into each website that loads Core Web Vital metrics, and sends data back to our receiver.
- receiver: A Node JS server that receives the data from the proxy and stores it in a CSV file.
- analysis: An R studio project that is used to analyse the data and generate graphs.
The following packages may need to be installed on the Raspberry Pi:
This experiment was designed to run on a Raspberry Pi 4 Model B with 4GB of RAM. The Raspberry Pi should be running the latest version of Raspberry Pi OS. To replicate the project, the following steps should be taken:
- Clone this repository onto the Raspberry Pi
- Clone the Android Runner in the parent directory of this repository
https://github.com/S2-group/android-runner.git
- Install the Android Runner dependencies
cd android-runner && pip3 install -r requirements.txt
- Install the python dependencies
pip3 install -r requirements.txt
- Install the node dependencies in the receiver directory
cd receiver && npm install
- Create 3 ssh sessions to the Raspberry Pi and run the following:
mitmproxy -s proxy.py
node receiver/app.js
ngrok http 3000
- The
ngrok
window will give you a https URL. Copy this URL into the.env
file. - Finally you can run the experiment using the following command:
sudo python3 android-runner android-runner/examples/batterymanager/config_web.json
All outputs will be stored in the android-runner/examples/batterymanager/output
directory.