Skip to content

Examining the relationship between Google's Core Web Vitals metrics and energy consumption on a Google Pixel 6.

Notifications You must be signed in to change notification settings

eoanodea/green-lab-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪴 Green Lab Core Web Vitals Experiment

📝 Authors

✏️ Description

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.

🏗️ Structure

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.

✅ Prerequisites

📱 Hardware

🖥️ Software

The following packages may need to be installed on the Raspberry Pi:

🤔 How to run

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:

  1. Clone this repository onto the Raspberry Pi
  2. Clone the Android Runner in the parent directory of this repository https://github.com/S2-group/android-runner.git
  3. Install the Android Runner dependencies
    cd android-runner && pip3 install -r requirements.txt
  4. Install the python dependencies
    pip3 install -r requirements.txt
  5. Install the node dependencies in the receiver directory
    cd receiver && npm install
  6. Create 3 ssh sessions to the Raspberry Pi and run the following:
    1. mitmproxy -s proxy.py
    2. node receiver/app.js
    3. ngrok http 3000
  7. The ngrok window will give you a https URL. Copy this URL into the .env file.
  8. 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.

About

Examining the relationship between Google's Core Web Vitals metrics and energy consumption on a Google Pixel 6.

Resources

Stars

Watchers

Forks

Languages