Skip to content

Commit

Permalink
fix TimeKiller online figs
Browse files Browse the repository at this point in the history
  • Loading branch information
FertileFragrance committed Apr 17, 2024
1 parent fb41e57 commit d24f3da
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 2 deletions.
Binary file not shown.
73 changes: 73 additions & 0 deletions examples/paper-timekiller/experiments/exp-online-flip-100-10.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
\documentclass[border=0pt]{standalone}
\input{../newcommands}
\pagestyle{empty} % Remove page numbering
\usepackage[left=68pt, right=0pt, top=72pt, bottom=0pt]{geometry}

\begin{document}
\pgfplotsset{height=140pt, width=200pt}
% https://tex.stackexchange.com/questions/6388/how-to-scale-a-tikzpicture-to-textwidth
\makeatletter
\newsavebox{\measure@tikzpicture}
\NewEnviron{scaletikzpicturetowidth}[1]{%
\def\tikz@width{#1}%
\def\tikzscale{1}\begin{lrbox}{\measure@tikzpicture}%
\BODY
\end{lrbox}%
\pgfmathparse{#1/\wd\measure@tikzpicture}%
\edef\tikzscale{\pgfmathresult}%
\BODY
}
\makeatother

\begin{minipage}{0.48\textwidth}
\begin{tikzpicture}
\begin{axis}[
x tick label style={draw=none},
title={(a)},
xlabel={Number of flip-flops},
ylabel={Count},
ybar,
xmin=0.5,
xmax=4.5,
ymin=0,
ymax=4000,
xtick=data,
xticklabels={1,2,3,4+},
legend pos=north east
]
\addplot coordinates {(1,2676) (2,267)
(3,33) (4,6)};
\addplot coordinates {(1,3564) (2,278)
(3,33) (4,6)};
\legend{txn,(txn, key)}
\end{axis}
\end{tikzpicture}
\end{minipage}
\hspace{-60pt}
\begin{minipage}{0.48\textwidth}
\begin{tikzpicture}
\begin{axis}[
x tick label style={draw=none},
title={(b)},
xlabel={Time (ms)},
%ylabel={Count},
ybar,
bar width=10,
bar shift=0,
xmin=0.5,
xmax=5.5,
ymin=0,
ymax=2000,
xtick={1,2,3,4,5},
xticklabels={0-1,1-2,2-10,10-99,1000+}
]
\addplot[color=red,fill=red!30] coordinates {(1,1582)};
\addplot[color=orange,fill=orange!30] coordinates {(2,1506)};
\addplot[color=brown,fill=brown!30] coordinates {(3,393)};
\addplot[color=blue,fill=blue!30] coordinates {(4,24)};
\addplot[color=black,fill=black!30] coordinates {(5,59)};
\end{axis}
\end{tikzpicture}
\end{minipage}
\hspace{-80pt}
\end{document}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
\documentclass[border=0pt]{standalone}
\input{../newcommands}
\pagestyle{empty} % Remove page numbering
\usepackage[left=68pt, right=0pt, top=72pt, bottom=0pt]{geometry}

\begin{document}
\pgfplotsset{height=140pt, width=200pt}
% https://tex.stackexchange.com/questions/6388/how-to-scale-a-tikzpicture-to-textwidth
\makeatletter
\newsavebox{\measure@tikzpicture}
\NewEnviron{scaletikzpicturetowidth}[1]{%
\def\tikz@width{#1}%
\def\tikzscale{1}\begin{lrbox}{\measure@tikzpicture}%
\BODY
\end{lrbox}%
\pgfmathparse{#1/\wd\measure@tikzpicture}%
\edef\tikzscale{\pgfmathresult}%
\BODY
}
\makeatother

\begin{minipage}{0.48\textwidth}
\begin{tikzpicture}
\begin{axis}[
% title={(30\%) writes; 10k txns}
title={(a) $N(\mu,10^2)$},
x tick style={draw=none},
xlabel={$\mu$},
ylabel={(txn, key) count},
ymin=0,
ymax=4200,
ybar stacked,
bar width=15,
area legend,
legend pos=south east,
xtick=data,
xticklabels={50,100,200,300,400,500}
]
\addplot[color=blue, pattern color=blue, pattern=crosshatch] table [x expr=\coordindex, y=1, col sep=comma] {./data/flip-mu-txnk.csv};
\addplot[color=red, pattern color=red, pattern=crosshatch dots] table [x expr=\coordindex, y=2, col sep=comma] {./data/flip-mu-txnk.csv};
\addplot[color=black, pattern color=black,pattern=north west lines] table [x expr=\coordindex, y=3, col sep=comma] {./data/flip-mu-txnk.csv};
\addplot[color=brown, pattern color=brown, fill=brown] table [x expr=\coordindex, y=4+, col sep=comma] {./data/flip-mu-txnk.csv};
\legend{1,2,3,4+}
\end{axis}
\end{tikzpicture}
\end{minipage}
\hspace{-60pt}
\begin{minipage}{0.48\textwidth}
\begin{tikzpicture}
\begin{axis}[
% title={(30\%) writes; 10k txns}
title={(b) $N(100,\sigma^2)$},
x tick style={draw=none},
xlabel={$\sigma$},
%ylabel={(txn, key) count},
ymin=0,
ymax=7000,
ybar stacked,
bar width=15,
area legend,
legend pos=south east,
xtick=data,
xticklabels={1,10,20,30,40,50}
]
\addplot[color=blue, pattern color=blue, pattern=crosshatch] table [x expr=\coordindex, y=1, col sep=comma] {./data/flip-sigma-txnk.csv};
\addplot[color=red, pattern color=red, pattern=crosshatch dots] table [x expr=\coordindex, y=2, col sep=comma] {./data/flip-sigma-txnk.csv};
\addplot[color=black, pattern color=black,pattern=north west lines] table [x expr=\coordindex, y=3, col sep=comma] {./data/flip-sigma-txnk.csv};
\addplot[color=brown, pattern color=brown, fill=brown] table [x expr=\coordindex, y=4+, col sep=comma] {./data/flip-sigma-txnk.csv};
%\legend{1,2,3,4+}
\end{axis}
\end{tikzpicture}
\end{minipage}
\hspace{-80pt}
\end{document}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
\documentclass{standalone}
\input{../newcommands}

\input{pgfplotsset}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={\#ops/txn},
ylabel={Database throughput (TPS)},
ymax=450,
ymin=0,
]
\addplot[color=blue,mark=square,mark size=3pt] table [x=nevt, y=normal, col sep=comma] {./data/throughput-nevt.csv};
\addplot[color=red,mark=triangle,mark size=3pt] table [x=nevt, y=collect, col sep=comma] {./data/throughput-nevt.csv};
\legend{normal,collect}
\end{axis}
\end{tikzpicture}
\end{document}
Binary file modified examples/paper-timekiller/experiments/exp-online-throughput.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
\begin{axis}[
title={(a)},
xlabel={\#ops/txn},
ylabel={TPS},
ylabel={Database throughput (TPS)},
ymax=450,
ymin=0,
]
Expand All @@ -37,7 +37,7 @@
\begin{axis}[
title={(c)},
xlabel={ read proportion \%},
ylabel={TPS},
ylabel={Database throughput (TPS)},
ymax=450,
ymin=0,
legend pos=north west
Expand Down

0 comments on commit d24f3da

Please sign in to comment.