This project is part of a master's thesis focused on measuring the energy consumption of unit tests. The goal is to analyze the energy efficiency of various sorting to determine how useful this approach is, using tools like PAPI and RAPL to gather energy consumption data. The results are then stored and analyzed using a time-series database for further research and comparison across multiple runs.
- Energy Efficiency Testing: Measures the energy consumption of unit tests using PAPI and RAPL energy readings inside a .Net project.
- Time-Series Analysis: Stores and analyzes energy metrics over multiple test runs using a time-series database (InfluxDB).
- Data Plotting: Python Scripts to plot the data from the time-series database.
- Languages: C, C#, Python
- Frameworks: xUnit for unit testing, .Net for the example application
- Measurement Tool: PAPI (with RAPL)
- Time-Series Database: InfluxDB for storing energy consumption metrics
First, ensure all requirements are installed and working as expected to run the program. Afterwards, the following setup steps are necessary:
export PAPI_DIR=PATH_TO_PAPI
To find the PAPI directory use:
export PATH=${PAPI_DIR}/bin:$PATH
export LD_LIBRARY_PATH=${PAPI_DIR}/lib:$LD_LIBRARY_PATH
sudo find / -name "libpapi.so" 2>/dev/null
Afterwards, to run the project use the following commands:
cd CpuIntensiveApp
gcc -fPIC -shared -o papi_wrapper.so papi_wrapper.c -I/${PAPI_DIR}/include -L/${PAPI_DIR}/lib -lpapi -lcurl
cd ../CpuIntensiveApp.Tests
sudo env LD_LIBRARY_PATH=LIBRARY_PATH dotnet test
Inside the Plot-Data folder, one can find 2 scripts to plot the data stored inside InfluxDb.