Skip to main content

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:

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

manafa-0.2.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distributions

manafa-0.2.0-py3.8.egg (17.7 kB view hashes)

Uploaded Source

manafa-0.2.0-py3-none-any.whl (2.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page