Created
April 5, 2017 06:19
-
-
Save roblogic/c7b0bb462466f8fae6e41ef246e77b57 to your computer and use it in GitHub Desktop.
Jmeter log processing script (probably obsolete)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# jtlmin.sh : | |
# JMeter log processing script | |
# Collects & Averages throughput data using 1-minute increments | |
# Requires CSV-formatted log from JMeter "Simple Data Writer". | |
# | |
# Version Date Author Comment | |
# 2.0 2009-02-17 R. Papesch Refined awk procedure, renamed variables | |
# 1.0 2006-11-28 R. Papesch | |
#set -x #debug | |
USAGE="Usage: jtlmin.sh \nSummarizes JMeter JTL output into 1-minute blocks" | |
[ $1 ] || { echo -e $USAGE; exit 1 ; } | |
echo -e "Processing \c" | |
ls $1 || { exit 1 ; } | |
main() | |
{ | |
WORKFILE=$1.jtlmin.$$.WORKING | |
OUTFILE=$1.jtlmin.$$.OUT | |
STEP=60 # $WORKFILE | |
echo "Outputting data to $OUTFILE .." | |
echo "$PWD/$1" >> $OUTFILE | |
echo -e "unixtime \tdate \ttime \tthruput(tpm) \tresponse(ms) " >> $OUTFILE | |
awk_routine | sort >> $OUTFILE | |
rm $WORKFILE | |
} | |
awk_routine() | |
{ | |
awk ' | |
NR!=1 {minute[$1]++; rsum[$1]=rsum[$1]+$2} | |
END { | |
for (i in minute) { | |
printf("%d\t", i); | |
printf("%s\t", strftime("%Y.%b.%d",i)); | |
printf("%s\t", strftime("%H:%M",i)); | |
printf("%d\t", minute[i]); | |
printf("%d\n", rsum[i]/minute[i]) | |
} | |
}' $WORKFILE | |
} | |
main $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background here. And more examples here. Originally designed for parsing JTL output from JMeter 2.2 with unix timestamps.