Commit ec5ed84c authored by Alain O' Miniussi's avatar Alain O' Miniussi

Convert team cpu time data to JS format.

parent bb7e0cf9
#!/usr/bin/env bash
idir="./cpu_times"
verbose=""
while getopts "hi:vo:" opt
do
case $opt in
h)
echo "Usage: $0 -i <cpu_time dir> [-h] [-v]."
exit 1
;;
v)
verbose=1
;;
i)
idir=$OPTARG
;;
?)
echo "Unknow option $opt" >2
;;
esac
done
if [ -z "$idir" ]
then
echo "Missing -i <time dir>" >&2
exit -1
fi
units=$(ls $idir | sort)
echo "var units = ["
for unit in $units
do
echo " '$unit',"
done
echo "];"
echo "var data = ["
coloridx=1
for unit in $units
do
echo " {"
echo " y: $(cat $idir/$unit/_total),"
echo " color: colors[$coloridx],"
let coloridx++
echo " drilldown: {"
echo " name: '$unit',"
echo " teams: ["
teams=$(cat $idir/$unit/teams.sorted | awk '{print $1;}')
for team in $teams
do
echo " '$team'," | sed -e 's/<other>/others/'
done
echo " ],"
echo " data : ["
cpu_times=$(cat $idir/$unit/teams.sorted | awk '{print $2;}')
for cpu_time in $cpu_times
do
echo " $cpu_time,"
done
echo " ]"
echo " }"
echo " },"
done
echo "];"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment