# get all the time info from logs (in seconds)
grep "seconds)" ../logs/stream_0.log > time_0.log
grep "seconds)" ../logs/stream_1.log > time_1.log
grep "seconds)" ../logs/stream_2.log > time_2.log
grep "seconds)" ../logs/stream_3.log > time_3.log
grep "seconds)" ../logs/stream_4.log > time_4.log
grep "seconds)" ../logs/stream_5.log > time_5.log
grep "seconds)" ../logs/stream_6.log > time_6.log
grep "seconds)" ../logs/stream_7.log > time_7.log
grep "seconds)" ../logs/stream_8.log > time_8.log

# remove the time to set options at the beginning of the queries
sed -i '1,23d' time_0.log
sed -i '1,23d' time_1.log
sed -i '1,23d' time_2.log
sed -i '1,23d' time_3.log
sed -i '1,23d' time_4.log
sed -i '1,23d' time_5.log
sed -i '1,23d' time_6.log
sed -i '1,23d' time_7.log
sed -i '1,23d' time_8.log

# get time for each query (in seconds)
./sortAndCollect.py 0 > pwr.csv
./sortAndCollect.py 1 > stream_1.csv
./sortAndCollect.py 2 > stream_2.csv
./sortAndCollect.py 3 > stream_3.csv
./sortAndCollect.py 4 > stream_4.csv
./sortAndCollect.py 5 > stream_5.csv
./sortAndCollect.py 6 > stream_6.csv
./sortAndCollect.py 7 > stream_7.csv
./sortAndCollect.py 8 > stream_8.csv

# get query average time in throughput test (in seconds)
./sortAndCollect.py 1 2 3 4 > tt1.csv
./sortAndCollect.py 5 6 7 8 > tt2.csv

