stats
This commit is contained in:
parent
09678965e0
commit
dc34e5b881
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "usage: $0 result-directory"
|
||||
@ -8,14 +7,7 @@ fi
|
||||
|
||||
d=$1
|
||||
|
||||
echo "from data (.d) to truncated data (.t)"
|
||||
for i in $d/*.d
|
||||
do
|
||||
fname=$(echo $i | sed "s/[.]d$/.t/")
|
||||
awk '{ print $2, $3, $5 }' < $i > $fname
|
||||
done
|
||||
|
||||
awk '{ print $1 }' < $d/ram_index.d > it
|
||||
awk '{ print $1 }' < $d/ram_index.d | sort -n | uniq > it
|
||||
mkdir data
|
||||
|
||||
echo "from truncated data (.t) to graphed data data/XXX.d"
|
42
bin/stats.sh
42
bin/stats.sh
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
extract="./bin/extract-final-data.sh"
|
||||
summary="./bin/summary.r"
|
||||
summary_to_line="./bin/rsum2line.awk"
|
||||
# .raw -> bad format -> .summary (great format)
|
||||
raw2sum="./bin/raw-to-summary.sh"
|
||||
# .summary (with too much data) -> truncated data (.t)
|
||||
truncate_data="./bin/summary-to-truncated-data.sh"
|
||||
# ./bin/extract-data-*.sh: .t -> data/XXX.d (paste an index + *.t)
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
@ -12,29 +14,7 @@ fi
|
||||
|
||||
dir="$1"
|
||||
|
||||
raw_to_summary() {
|
||||
for i in $dir/*.raw
|
||||
do
|
||||
summary_with_bad_format=$(echo $i | sed "s/.raw$/.unconveniently_formated_summary/")
|
||||
target=$(echo $i | sed "s/.raw$/.summary/")
|
||||
if [ -f $summary_with_bad_format ]; then
|
||||
echo -n "\r$summary_with_bad_format already exists: skipping "
|
||||
else
|
||||
Rscript $summary $i > $summary_with_bad_format
|
||||
fi
|
||||
if [ -f $target ]; then
|
||||
echo -n "\r$target already exists: skipping "
|
||||
else
|
||||
$summary_to_line $summary_with_bad_format > $target
|
||||
fi
|
||||
done
|
||||
echo ""
|
||||
|
||||
# Beyond a certain number of entries, retrieving data from partitions and tags isn't tested anymore.
|
||||
# This leads to create "fake entries" with a duration of 0, resulting to causing some problems with
|
||||
# statistical analysis. So, we need to replace "NaN" by "0" in summaries.
|
||||
sed -i "s/NaN/0/g" $dir/*.summary
|
||||
}
|
||||
$raw2sum "${dir}"
|
||||
|
||||
# List raw files with the number of iterations as a prefix so they can then be sorted.
|
||||
sort_summary_files() {
|
||||
@ -46,6 +26,8 @@ f() {
|
||||
}
|
||||
|
||||
fill() {
|
||||
# Remove previous computations.
|
||||
rm ${dir}/*.d
|
||||
while read LINE; do
|
||||
nb_it=$(echo $LINE | awk '{ print $1 }')
|
||||
target=$(echo $LINE | awk '{ print $2 }')
|
||||
@ -55,12 +37,6 @@ fill() {
|
||||
done
|
||||
}
|
||||
|
||||
raw_to_summary
|
||||
|
||||
sort_summary_files | fill
|
||||
|
||||
extract_final_data() {
|
||||
$extract $dir
|
||||
}
|
||||
|
||||
extract_final_data
|
||||
$truncate_data "${dir}"
|
||||
|
16
bin/summary-to-truncated-data.sh
Executable file
16
bin/summary-to-truncated-data.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo "usage: $0 result-directory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
dir=$1
|
||||
|
||||
echo "from data (.d) to truncated data (.t)"
|
||||
for i in $dir/*.d
|
||||
do
|
||||
fname=$(echo $i | sed "s/[.]d$/.t/")
|
||||
awk '{ print $2, $3, $5 }' < $i > $fname
|
||||
done
|
Loading…
Reference in New Issue
Block a user