Commit 392dcab2 authored by David BAELDE's avatar David BAELDE

Analyze size distribution of captured requests

Suprisingly, size does not matter (for coverage).
parent df9c48d0
*gnuplottex-fig*eps
*gnuplottex-fig*gnuplot
*gnuplottex-fig*tex
*gnuplottex-fig*pdf
*.aux
*.log
*.gnuploterrors
benchmarks-xquery-full.xml
benchmarks-xslt-full.xml
benchmarks-xquery.xml
benchmarks-xslt.xml
benchmarks-all.xml
all: dist.dat axis-count.tex size-gte-100.tex matrices
all: dist.dat axis-count.tex size-gte-100.tex matrices captured_dist.dat
BENCHMARKS=benchmarks-all.xml \
benchmarks-xslt-full.xml benchmarks-xslt.xml \
......@@ -6,7 +6,7 @@ BENCHMARKS=benchmarks-all.xml \
matrices: $(BENCHMARKS)
ant
clean:
rm -f dist.dat axis-count.tex size-gte-100.tex
rm -f dist.dat axis-count.tex size-gte-100.tex captured_dist.dat
rm -f $(BENCHMARKS)
rm -f matrix_*_*.tex totals_*_*.tex
......@@ -18,6 +18,10 @@ axis-count.tex: $(wildcard ../../benchmark/*-axis-step.xml)
dist.dat: $(wildcard ../../benchmark/*-full.xml)
./distribution.sh > dist.dat
captured_dist.dat: $(wildcard ../../benchmark/*-full.xml)
./captured_distr.sh > captured_dist.dat
captured_dist.pdf: captured_dist.dat captured_dist.tex
pdflatex --shell-escape captured_dist.tex
%.xml: %-full.xml
cat $< | sed -e 's/-full.xml/.xml/' > $@
......
\documentclass[10pt]{article}
\usepackage[a4paper,vmargin=.5cm]{geometry}
\usepackage{gnuplottex}
\begin{document}
\enlargethispage{5cm}
\begin{figure*}[htp]
\centering
% you need to compile with `pdflatex --shell-escape`
\begin{gnuplot}[terminal=cairolatex, terminaloptions={color size
11.0cm,6.0cm}]
set logscale y
plot "captured_dist.dat" using 1:2 title "nb of requests"
\end{gnuplot}
\caption{Distribution of request sizes (all requests).}
\end{figure*}
\begin{figure*}[htp]
\centering
% you need to compile with `pdflatex --shell-escape`
\begin{gnuplot}[terminal=cairolatex, terminaloptions={color size
11.0cm,6.0cm}]
set logscale y
plot "captured_dist.dat" using 1:3 title "nb of captured requests"
\end{gnuplot}
\caption{Distribution of request sizes (captured only).}
\end{figure*}
\begin{figure*}[htp]
\centering
% you need to compile with `pdflatex --shell-escape`
\begin{gnuplot}[terminal=cairolatex, terminaloptions={color size
11.0cm,6.0cm}]
set logscale y
plot "captured_dist.dat" using 1:($2-$3) title "nb of uncaptured requests"
\end{gnuplot}
\caption{Distribution of request sizes (not captured).}
\end{figure*}
\begin{figure*}[htp]
\centering
% you need to compile with `pdflatex --shell-escape`
\begin{gnuplot}[terminal=cairolatex, terminaloptions={color size
11.0cm,6.0cm}]
set logscale y
plot "captured_dist.dat" using 1:2 title "nb of requests",\
"captured_dist.dat" using 1:3 title "nb of captured requests"
\end{gnuplot}
\caption{Distribution of request sizes (both).}
\end{figure*}
\begin{figure*}[htp]
\centering
% you need to compile with `pdflatex --shell-escape`
\begin{gnuplot}[terminal=cairolatex, terminaloptions={color size
11.0cm,6.0cm}]
set yrange [-0.5:1.5]
plot "captured_dist.dat" using 1:($3/$2) title "proportion of captured
requests"
\end{gnuplot}
\caption{Proportion of captured requests by size}
\end{figure*}
\end{document}
#!/bin/bash
# Maximum allowed size of XPath queries in benchmark
MAX=`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java| sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`
# XPath query that recognizes schemas of -full fragments
Q="false"
for f in `xmlstarlet sel -t -v "//schema/@file" \
-n ../../relaxng/fragments-full.xml` ; do
Q="$Q or @schema='$f'"
done
# For each possible size, count queries in benchmark,
# and count queries that fall in at least one -full fragment.
for ((i = 1; i < $MAX; ++i))
do
C=`grep "ast depth=.* size=\"$i\"" ../../benchmark/*-full.xml | wc -l`
N=0
[ C = 0 ] || for n in `xmlstarlet sel -t -c \
"count(//xpath[ast/@size=$i and schemas/validation[$Q]/@valid='yes'])" \
-n ../../benchmark/*-full.xml` ; do
N=$(($n+$N))
done
echo "$i $C $N"
done
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