-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph-xmppsvr-command
executable file
·39 lines (38 loc) · 1.49 KB
/
graph-xmppsvr-command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#
# graph-xmppsvr-command <process-tcp> <process-command> <process-nginx> "title"
#
# - process-tcp time,date,SYN,SYNACK,FIN,RST
# - process-command time,date,incoming_device,incoming_wait,other,accu,200,400
# - process-nginx time,date,counter,error,other
#
tcp_file=$1
command_file=$2
nginx_file=$3
title=$4
(
echo "set terminal png size 1200,1600"
echo "set multiplot layout 4,1"
echo "set datafile separator \",\""
echo "set xlabel \"Time Elapsed\""
# echo "set boxwidth 1.0"
echo "set xdata time"
echo "set timefmt \"%s\""
echo "set format x \"%H:%M\"" # or anything else
echo "set title \"$title\""
echo "set ylabel \"Network\""
echo "plot \"$tcp_file\" using 1:3 t \"SYN/s\" w boxes fill solid 1.0, \\"
echo " '' using 1:4 t \"SYN-ACK/s\" w boxes fill solid 1.0, \\"
echo " '' using 1:5 t \"FIN/s\" w boxes, \\"
echo " '' using 1:6 t \"RST/s\" w boxes"
echo "set ylabel \"Application\""
echo "plot \"$command_file\" using 1:3 t \"connected\" w linespoint, \\"
echo " '' using 1:4 t \"disconnected\" w linespoint"
echo "set ylabel \"accumulated\""
echo "plot \"$command_file\" using 1:(\$7 == 0 ? NaN : \$7) t \"clients\" w linespoint"
echo "set ylabel \"Nginx\""
echo "plot \"$nginx_file\" using 1:3 t \"Nginx Counter\" w boxes fill solid 1.0, \\"
echo " '' using 1:4 t \"Nginx Err/s\" w boxes fill solid 1.0"
#echo "set ylabel \"MB\""
#echo "plot \"$recording\" using 1:(\$13 / 1024) t \"RSS\" w linespoint"
) | gnuplot > ${tcp_file}-complete.png