From c3611f7f64f274d6764e7f13283f236d4ca69ecc Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 18 Jun 2017 14:27:05 +0200 Subject: add db stats --- cron.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'cron.sh') diff --git a/cron.sh b/cron.sh index 109c55f..9e44c04 100644 --- a/cron.sh +++ b/cron.sh @@ -17,9 +17,10 @@ find $LOGS -name "apigrabber-out*__????-??-??_??-??-??.log"\ put '$date = sec2gmt(gmt2sec($date) // (60*60*3) * (60*60*3));' \ then cut -f date,connection_end \ then stats1 -a min,mean,max -f connection_end -g date \ + then sort -f date \ >> $PF.csv -gnuplot -e "inputfile='$PF.csv'; outputfile='$PF.png';" connection_end_over_time.plt +gnuplot -e "inputfile='$PF.csv'; outputfile='$PF.png';" $DATA/../connection_end_over_time.plt PF=$DATA/apigrabber_error_processed # progress file @@ -35,6 +36,47 @@ find $LOGS -name "apigrabber-error*__????-??-??_??-??-??.log"\ put '$date = sec2gmt(gmt2sec($date) // (60*60*3) * (60*60*3));' \ then cut -f date \ then stats1 -a count -f date -g date \ + then sort -f date \ >> $PF.csv -gnuplot -e "inputfile='$PF.csv'; outputfile='$PF.png';" errors_over_time.plt +gnuplot -e "inputfile='$PF.csv'; outputfile='$PF.png';" $DATA/../errors_over_time.plt + + +PF=$DATA/processor_processed # progress file +touch $PF $PF.csv +find $LOGS -name "processor-out*__????-??-??_??-??-??.log"\ + | sort\ + | comm -13 $PF - \ + | tee -a $PF \ + | xargs grep -h " database transaction " \ + | sed -E 's_^(.*?) - .*? database transaction _date=\1, _g' \ + | mlr --fs ", " \ + --ocsv \ + put '$date = sec2gmt(gmt2sec($date) // (60*60*3) * (60*60*3));' \ + then put '$duration = gsub($duration, "ms", "");' \ + then cut -f date,duration \ + then stats1 -a mean,count -f duration -g date \ + then sort -f date \ + | grep -v "1970" \ + >> $PF.csv + +gnuplot -e "inputfile='$PF.csv'; outputfile='$PF.png';" $DATA/../transactions_over_time.plt + + +PF=$DATA/processor_batch_processed # progress file +touch $PF $PF.csv +find $LOGS -name "processor-out*__????-??-??_??-??-??.log"\ + | sort\ + | comm -13 $PF - \ + | tee -a $PF \ + | xargs grep -h " processing batch " \ + | sed -E 's_^(.*?) - .*? processing batch _date=\1, _g' \ + | mlr --fs ", " \ + --ocsv \ + put '$date = sec2gmt(gmt2sec($date) // (60*60*3) * (60*60*3));' \ + then stats1 -a count -f players,matches,telemetries -g date \ + then sort -f date \ + | grep -v "1970" \ + >> $PF.csv + +gnuplot -e "inputfile='$PF.csv'; outputfile='$PF.png';" $DATA/../objects_over_time.plt -- cgit v1.3.1