aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-30 12:03:22 -0400
committerFranklin Wei <me@fwei.tk>2018-07-30 12:03:22 -0400
commit8be4b2fb7a04c2ea095263d462a4284af345ab80 (patch)
treeb0cbaf0b3b66b7a5bd6aa3a70a50ff5d9b12a54a
parent4f8e4363db9bb3dde4edc0746f8d18c3216d6f0b (diff)
downloadcsaa-8be4b2fb7a04c2ea095263d462a4284af345ab80.zip
csaa-8be4b2fb7a04c2ea095263d462a4284af345ab80.tar.gz
csaa-8be4b2fb7a04c2ea095263d462a4284af345ab80.tar.bz2
csaa-8be4b2fb7a04c2ea095263d462a4284af345ab80.tar.xz
WIP on processing data from new profile
tabulate.sh is partially updated; dummy hasn't been updated, though, and we still can't produce graphs.
-rw-r--r--client.c7
-rwxr-xr-xgraph.gnu2
-rw-r--r--postprocess.cpp2
-rwxr-xr-xtabulate.sh32
4 files changed, 23 insertions, 20 deletions
diff --git a/client.c b/client.c
index 5fc8f82..b81902a 100644
--- a/client.c
+++ b/client.c
@@ -593,14 +593,13 @@ void prof_dump(struct server_profile *profile)
clock_t sum = 0;
/* TODO: use partial sums? */
- for(int i = 0; i < profile->n_times; ++i)
+ for(int i = 1; i < profile->n_times; ++i)
{
fprintf(stderr, "%ld ", profile->times[i] - profile->times[i - 1]);
- if(i > 0)
- sum += profile->times[i] - profile->times[i - 1];
+ sum += profile->times[i] - profile->times[i - 1];
}
- fprintf(stderr, "%ld\n", sum);
+ fprintf(stderr, "\n");
}
bool server_request(const char *sockpath,
diff --git a/graph.gnu b/graph.gnu
index f039bdb..636bd1b 100755
--- a/graph.gnu
+++ b/graph.gnu
@@ -1,7 +1,7 @@
#!/usr/bin/gnuplot
set xlabel "logleaves"
set ylabel "avg time per operation (sec)"
-set yrange [0:]
+set yrange [0:.04]
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt -1 ps 0
set style line 3 pt -1 ps 0
set terminal eps
diff --git a/postprocess.cpp b/postprocess.cpp
index 45a8235..349a4ec 100644
--- a/postprocess.cpp
+++ b/postprocess.cpp
@@ -31,7 +31,7 @@ int main()
{
int x;
double y;
- unsigned long long div;
+ unsigned long long div = 1;
cin >> x >> y >> div;
values[x][counts[x]] = y / div;
diff --git a/tabulate.sh b/tabulate.sh
index 7698cc7..872d8f2 100755
--- a/tabulate.sh
+++ b/tabulate.sh
@@ -1,6 +1,9 @@
#!/bin/bash
trials=2
runs_test=500
+create_times=4
+modify_times=1
+retrieve_times=1
rm -f all_*.txt dummy_all_*.txt
@@ -10,8 +13,16 @@ do
do
echo -n "$i $j " >> all_"$i".txt
echo -n "$i $j " >> dummy_all_"$i".txt
- cat run_"$i"_"$j".txt | awk '/Elapsed/ || /Maximum/ || /User time/ || /System time/' | awk 'BEGIN{line=0}{if(line%4<=1)printf($4" ");if(line %4==2)printf($8" ");if(line%4==3)printf($6" ");}{line+=1}END{printf("\n");}' >> all_"$i".txt
-
+
+ # 5 operations
+ for k in `seq 0 4`
+ do
+ start=$(expr $runs_test \* $k + 1)
+ end=$(expr $runs_test \* \( $k + 1 \))
+ cat run_"$i"_"$j".txt | sed -n $start,$runs_test'p' | ../average.sh | awk '{printf($1" ");}' >> all_"$i".txt
+ done
+ echo >> all_"$i".txt
+
cat dummy_"$i"_"$j".txt | awk '/Elapsed/ || /Maximum/ || /User time/ || /System time/' | awk 'BEGIN{line=0}{if(line%4<=1)printf($4" ");if(line %4==2)printf($8" ");if(line%4==3)printf($6" ");}{line+=1}END{printf("\n");}' >> dummy_all_"$i".txt
done
done
@@ -20,18 +31,11 @@ rm -f data_create.txt data_modify.txt data_retrieve.txt data_modifyenc.txt data_
rm -f data_dummy_create.txt data_dummy_modify.txt data_dummy_retrieve.txt
cat all_*.txt | awk '{
-runs_create=lshift(1, $1);
-runs_test='$runs_test';
-if(NF >= 5)
- print $1, $5, runs_test >> "data_create.txt";
-if(NF >= 9)
- print $1, $9, runs_test >> "data_modify.txt"
-if(NF >= 13)
- print $1, $13, runs_test >> "data_retrieve.txt"
-if(NF >= 17)
- print $1, $17, runs_test >> "data_modifyenc.txt"
-if(NF >= 21)
- print $1, $21, runs_test >> "data_retrieveenc.txt"
+ print $1, $3, $4, $5, $6 >> "data_create.txt";
+ print $1, $7 >> "data_modify.txt"
+ print $1, $8 >> "data_retrieve.txt"
+ print $1, $9 >> "data_modifyenc.txt"
+ print $1, $10 >> "data_retrieveenc.txt"
}'
cat dummy_all_*.txt | awk '{