some todo done
This commit is contained in:
@@ -103,16 +103,107 @@ class LogAnalyzer(Analyzer):
|
||||
|
||||
\end{lstlisting}
|
||||
|
||||
%TODO Remove this shit
|
||||
%----------------------------------------------------------------------------
|
||||
\clearpage\section{Válasz az ,,Élet, a világmindenség, meg minden'' kérdésére}
|
||||
%----------------------------------------------------------------------------
|
||||
A Pitagorasz-tételből levezetve
|
||||
\begin{align}
|
||||
c^2=a^2+b^2=42.
|
||||
\end{align}
|
||||
A Faraday-indukciós törvényből levezetve
|
||||
\begin{align}
|
||||
\rot E=-\frac{dB}{dt}\hspace{1cm}\longrightarrow \hspace{1cm}
|
||||
U_i=\oint\limits_\mathbf{L}{\mathbf{E}\mathbf{dl}}=-\frac{d}{dt}\int\limits_A{\mathbf{B}\mathbf{da}}=42.
|
||||
\end{align}
|
||||
\section{Folyamatos terhel\'est gener\'al\'o m\'er\'est v\'egző szkriptr\'eszlet Bash nyelven}
|
||||
\begin{lstlisting}[label=code:bash-banchmark-for]
|
||||
if [[ $* == *"--for"* ]]; then
|
||||
for num in 1 2 3 4 5 6 7 8 9 10; do
|
||||
echo -e "for $num\n"
|
||||
if $kubeless; then
|
||||
if [[ $* == *"--loadtest"* ]]; then
|
||||
loadtest -k -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$num".txt
|
||||
else
|
||||
hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" >./data/"$function"."$num".csv
|
||||
fi
|
||||
else
|
||||
if [[ $* == *"--loadtest"* ]]; then
|
||||
loadtest -k -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ >./data/"$function"."$num".for.csv
|
||||
else
|
||||
hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$num".for.csv
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
\end{lstlisting}
|
||||
|
||||
\clearpage
|
||||
\section{Emelkedő terhel\'est megval\'os\'itő m\'er\'es Bash szkriptnyelven}
|
||||
\begin{lstlisting}[label=code:bash-banchmark-climb]
|
||||
if [[ $* == *"--climb"* ]]; then
|
||||
while [[ $climb -lt $climb_max ]]; do
|
||||
climb_rps=$((rps * climb))
|
||||
echo -e "Rps: $climb_rps"
|
||||
if $kubeless; then
|
||||
if [[ $* == *"--loadtest"* ]]; then
|
||||
loadtest -k -H "Host: $function.kubeless" --rps $climb_rps -c 1 -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$climb_rps".climb.txt
|
||||
else
|
||||
hey -c $climb -q $rps -z $time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" >./data/"$function"."$climb_rps".climb.csv
|
||||
fi
|
||||
else
|
||||
if [[ $* == *"--loadtest"* ]]; then
|
||||
loadtest -k -H "Host: $function.default.example.com" --rps $climb_rps -c 1 -t $time http://$kuberhost/ >./data/"$function"."$climb_rps".climb.txt
|
||||
else
|
||||
hey -c $climb -q $rps -z $time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$climb_rps".climb.csv
|
||||
fi
|
||||
fi
|
||||
climb=$((climb + 1))
|
||||
done
|
||||
fi
|
||||
\end{lstlisting}
|
||||
|
||||
\section{Jmeter kimenet\'et feldolgoz\'o k\'odr\'eszlet, Python nyelven}
|
||||
\begin{lstlisting}[label=code:jmeter-analyze]
|
||||
class JmeterAnalyzer(CsvAnalyzer):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.responsepersec = {}
|
||||
|
||||
def processfile(
|
||||
self,
|
||||
fname,
|
||||
shouldprint: bool = False):
|
||||
with open(fname, 'r') as f:
|
||||
data = csv.reader(f)
|
||||
fields = next(data)
|
||||
for row in data:
|
||||
items = zip(fields, row)
|
||||
item = {}
|
||||
for (name, value) in items:
|
||||
item[name] = value.strip()
|
||||
sec = datetime.datetime.fromtimestamp(
|
||||
int(item['timeStamp']) / 1000.0).strftime('%c')
|
||||
if sec not in self.responsepersec:
|
||||
self.responsepersec[sec] = []
|
||||
self.responsepersec[sec].append(float(item['Latency']))
|
||||
|
||||
def collectinfo(self, shouldprint: bool = False) -> None:
|
||||
self.walkresponsepersec(self.responsepersec, shouldprint)
|
||||
\end{lstlisting}
|
||||
|
||||
\clearpage
|
||||
\section{Hey kimenet\'et feldolgoz\'o k\'odr\'eszlet, Python nyelven}
|
||||
\begin{lstlisting}[label=code:hey-analyze]
|
||||
class HeyAnalyzer(CsvAnalyzer):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def processfile(
|
||||
self,
|
||||
fname,
|
||||
shouldprint: bool = False):
|
||||
with open(fname, 'r') as f:
|
||||
data = csv.reader(f)
|
||||
fields = next(data)
|
||||
responsepersec = {}
|
||||
for row in data:
|
||||
items = zip(fields, row)
|
||||
item = {}
|
||||
for(name, value) in items:
|
||||
item[name] = value.strip()
|
||||
sec = int(item['offset'].split('.')[0])
|
||||
if sec not in responsepersec:
|
||||
responsepersec[sec] = []
|
||||
else:
|
||||
responsepersec[sec].append(float(item['response-time']))
|
||||
self.walkresponsepersec(responsepersec, shouldprint)
|
||||
|
||||
\end{lstlisting}
|
||||
|
||||
Reference in New Issue
Block a user