E-MANAFA: Energy Monitor and ANAlyzer For Android
Project description
petra-like
This tool is a software model-based tool, for performing fine-grained estimates of energy consumption on Android devices. For this purpose, it uses the values contained in the power_profile.xml file for each device and the BatteryStats and Perfetto services to estimate the energy consumption of each resource / component of the device.
SETUP
In order to run this tool, the following components are required:
- An Android rooted device (running Android 9 or above);
- A * nix-based environment;
- Android Sdk tools (https://developer.android.com/studio/releases/platform-tools)-
Installation
define environment variables
In order to run this tool, there are at least 2 env. variables that need to be defined in the shell startup script (e.g .bashrc or .bash_profile file)
export ANDROID_HOME=$HOME/android-sdk/
export PATH=$ANDROID_HOME/platform-tools:$PATH
Replicate the enviroment
Install virtual virtualenv enviroment (via python-pip):
$ python -m pip install --user virtualenv
##Replicate locally the dev virtualenv
$ virtualenv env/
Activate the virtual environment
$ source env/bin/activate
Extract power_profile file from device
(In progress)
Install required packages
$ pip install -r requirements.txt
Example
# getting the energy consumed in a profiling session (between first and last measurement)
g = GreenStats(power_profile=DEFAULT_PROFILE, timezone="EST")
g.init()
g.start()
do_some_work()
batstats_out_file, perfetto_out_file = g.stop()
g.parseResults( DEFAULT_PROFILE, batstats_out_file , perfetto_out_file )
begin = g.bat_events.events[0].time
end = g.bat_events.events[-1].time
consumption = g.getConsumptionInBetween(begin, end)
print("Energy consumed: %f Joules" % consumption)
TODO
- calibrate the model
- test using flashlight
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file manafa-0.2.1.tar.gz
.
File metadata
- Download URL: manafa-0.2.1.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29b82bf4dc077f73449af664099999b1e2770474cd8b04329ac5b1b42fabac99 |
|
MD5 | 51fbe271af31548283b59461d2b04826 |
|
BLAKE2b-256 | e0040749ebfa4d48cd356be664eecd7d61c3566d5fa9b12c1780c535d3eb5739 |
File details
Details for the file manafa-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: manafa-0.2.1-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fde5eabd9633bdfb43219c8251df62f3d67b053f3567b39d5661130cd0750c8 |
|
MD5 | 88891bfee0f4f12f1e56898e3f5d6b4a |
|
BLAKE2b-256 | 35985e3552cae4f0b0519c33397bcb95b7d5fbe0e585eaf0e31ac538c3e7ca34 |