README.md

PowTrAn

POWer TRace ANalyzer

Is an R package that is able to analyze power traces from repeated executions of software applications or algorithms in a efficient and accurate way.

Workflow

Taking as a reference the approach reported in the article Methodological Guidelines for Measuring Energy Consumption of Software Applications where four steps are identified:

  1. Goal (G): define the research question, the target device(s) on which the measurements will take place, and the context in which the SWUT is executed
  2. How (H): decide how consumption will be measured and the procedure needed to carry out the measurement
  3. Do (D): carry out the measurement and collect the data
  4. Analyse (A): analyse the data and address the research question(s)

The PowTrAn tool can be used in the initial part of the Analyse phase.

Analysis approach

The How approach supported by this tool is a physical measyre that uses no explicit synchronization but adopts markers.

The power traces are expected to be collected according to the following protocol:

E.g.

      __B__                  __B__
      |   |     __work__     |   |
      |   |     |      |     |   |
.__S__|   |__S__|      |__S__|   |__S__...

The effective power consumption is estimated by subtracting the sleep level power from the average power measured during the work phase.

This package is not currently on CRAN, to install it, use devtools:

install.packages("devtools") # if not already installed

devtools::install_github("SoftengPoliTo/powtran")

A sample usage is as follows:

voltage = 5  # V
period = 1/1000  # s

# the text file contains one current sample per row
filename = "tests/raspberrypi2_c_bubblesort_10000_3.txt"
current.samples = scan(filename,skip=1,quiet = TRUE)
res = extract.power(current.samples*voltage, # instant power [W]
                    period) 
plot(res)


SoftengPoliTo/powtran documentation built on April 16, 2020, 1:47 a.m.