Adding metrics to dramSylva

This commit is contained in:
Ana Mativi
2017-08-15 15:56:35 +02:00
parent 5b16c7caf5
commit 1ead5c0c32
2 changed files with 24 additions and 5 deletions

View File

@@ -24,8 +24,11 @@ $ cd build/simulator
$ vim output*
$ ls *.tdb
Additionally, the almighty dramSylva executes a plot generator script (already
provided in DRAMSys' repository) for every database file created.
The almighty dramSylva executes a plot generator script (already provided in
DRAMSys' repository) for every database file created.
Additionally, to top it all off, dramSylva creates a text output with the
metrics for each database file.
------------------------------------------------------------------------------
Why is it called dramSylva?

View File

@@ -30,7 +30,9 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Author: Éder F. Zulian
# Authors:
# Éder F. Zulian
# Ana Mativi
set -x
@@ -52,6 +54,8 @@ clocks="
1000
"
# Git user
git_user="$USER"
# Regular DRAMSys text output is redirected to files which names are based on
# the prefix and extension defined here.
out_prefix="output"
@@ -62,6 +66,8 @@ base_dir=$PWD
db_ext="tdb"
# Python script to generate plots
plots_script="plots.py"
# Python script to generate metrics
metrics_script="metrics.py"
# Python interpreter to use
python_interpreter="python3"
@@ -69,7 +75,7 @@ python_interpreter="python3"
function systole {
local current_time=$(date "+%Y.%m.%d-%H.%M.%S")
root_dir="dram.vp.system_$current_time"
`git clone --recursive git@git.rhrk.uni-kl.de:EIT-Wehn/dram.vp.system.git $root_dir`
`git clone --recursive https://$git_user@git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.system.git $root_dir`
cd $root_dir
git checkout master
git pull
@@ -150,7 +156,16 @@ function ecg {
local dbfiles=`ls *.${db_ext}`
local pspath="$(dirname $(find $base_dir/$root_dir -depth -name $plots_script))"
for f in $dbfiles; do
$python_interpreter $pspath/$plots_script $f
$python_interpreter $pspath/$plots_script $f
done
}
# Create metrics
function metrics {
local dbfiles=`ls *.${db_ext}`
local mspath="$(dirname $(find $base_dir/$root_dir -depth -name $metrics_script))"
for f in $dbfiles; do
$python_interpreter $mspath/$metrics_script $f > ${f}_metrics.$out_ext
done
}
@@ -158,3 +173,4 @@ systole
heartbeat
washup
ecg
metrics