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.
Taking as a reference the approach reported in the article Methodological Guidelines for Measuring Energy Consumption of Software Applications where four steps are identified:
The PowTrAn tool can be used in the initial part of the Analyse phase.
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:
each work unit must be preceded a and followed by a marker
the markers consist in a square pulse that has to be generated by a fragment of code keeping the processor as busy as possible. The pulse is preceded by (equally long) sleep period.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.