Skip to content

Instantly share code, notes, and snippets.

View roblogic's full-sized avatar
💭
probably playing code golf

Rob Papesch roblogic

💭
probably playing code golf
  • Auckland, NZL
  • 18:21 (UTC +12:00)
View GitHub Profile
@roblogic
roblogic / autozip
Last active May 25, 2017 04:06
Zip the output from a custom test framework (soapUI + groovy + excel spreadsheets, you don't wanna know...)
#!/bin/sh
# autozip.sh
# Tidies up SoapUI xml results. Archives approx 9000 files/minute.
# identify the unique pattern (RUN_ID) for an execution run
ls -1 *ExecReport* | grep -v Latest | sed 's/^.*ExecReport-//;s/.htm//' | cut -c -12 | while read RUN_ID
do
# figure out a name for the zip file
PREFIX=`ls *ExecReport-$RUN_ID* | awk -F. '{print $1}' | head -1`
SUFFIX=`ls *ExecReport-$RUN_ID* | awk -F[.-] '{print $(NF-1)}' | head -1`
@roblogic
roblogic / Scientist.sh
Last active August 9, 2017 00:23
Bash version of github's "Scientist"
#!/bin/sh
# Scientist.sh
# Sends Production data from host930, to ClaimPoints *TEST* URL
# ClaimPoints experiment inspired by GitHub (mind blown!)
# http://githubengineering.com/move-fast/
# http://githubengineering.com/scientist/
#set -x
USAGE='Usage : ./CPTtestrun.sh <ClaimPoints-XML-File>
Example : ./CPTtestrun.sh host930.accrualservices-CPT1.6-2016111715
@roblogic
roblogic / vim on windows.md
Last active July 19, 2017 01:02
Notes to self, some common vim use cases
@roblogic
roblogic / get_issuu.rb
Created May 16, 2017 08:42
Ruby script: download document JPGs from ISSUU
#-------------------------------------------------
# get_issuu.rb - retrieve all jpg's for a document
#-------------------------------------------------
# 1. Open the issuu.com document in your web browser, as usual
# example: http://issuu.com/iwishart/docs/thedivinity
# 2. Read the document page count; set variable $PAGES below
# 3. From browser menu, choose View > Source
# 4. Do a text search for "documentId"
# 5. Copy string such as "081230122554-f76b0df1e7464a149caf5158813252d9"
@roblogic
roblogic / getmsg.sh
Created May 18, 2017 00:31
Parse XML of known structure and print selected data on 1 line. Good for analysis of several XMLs from a file.
#!/bin/sh
# get interesting fields from the published XML and print it on one line
[ $1 ] || { echo "usage: getmsg.sh <input-xml-file>" ; exit 1 ; }
[ -f $1 ] || { ls $1 ; exit 1 ; }
inputxml=$1
echo "CustomerPub XML message contents:"
while read line ; do
echo "$line" | xmllint --format - \
| awk -F'ns2:Domain>|ns2:Name>|ns2:ValueBefore:>|ns2:ValueAfter>|ns3:AttributeValue>|ns2:EventTime>' '{print $2}' \
| grep . | tr '\n' ' ' | sed 's/<\///g'
@roblogic
roblogic / jstats2
Last active July 20, 2021 09:11
jstats2 - Parse Jmeter output (csv), compute statistics about the test execution and response times.
#!/bin/bash
# Parse jmeter output and get various stats
# Hat-tip to 'stig', https://git.io/vFmeI
set -e # Exit immediately on error
# set -x # Debug
usage="jstats2 <jmeter-csv-output-file>"
[ $1 ] || { echo "$usage" ; exit 1 ; }
JFILE=$1
# Show timestamp info
@roblogic
roblogic / Compare distributions with Gnuplot.md
Last active May 26, 2020 03:22
How to get response time distributions from Jmeter data, and plot the data to compare performance.

Comparing Response Distributions with Gnuplot

Bash script to get Response data

Analyse Jmeter CSV output using jstats2. The response values are in tmp files. Get frequency of response times into .dat files, using uniq and awk per below...

$ uniq -c /tmp/jstats2.1hASD | awk '{print $2, $1}' | sort -n > FPE10-50k-24May-freq.dat
$ uniq -c /tmp/jstats2.lJAVX | awk '{print $2, $1}' | sort -n > FPE11a-GetJourneys-freq.dat
$ uniq -c /tmp/jstats2.lEV2M | awk '{print $2, $1}' | sort -n &gt; FPE11b-JourneyKnown-freq.dat
@roblogic
roblogic / getevent
Last active February 2, 2018 05:06
Parse xml from a log file and print selected data, 1 line per message
#!/bin/sh
# hacky script to get just the interesting stuff from the published XML
[ $1 ] || { echo "Usage: getevent <CustomerEventPub log name>" ; exit 1 ; }
EVLOG=$1
STR1="CustomerProfileEvent Message: "
XFILE=$(mktemp /tmp/getx.XXXXX) || exit 1
awk -F"$STR1" 'NF>1 {print $2}' $EVLOG > $XFILE
echo "CustomerProfileEvent Message contents from $XFILE"
while read line ; do
echo "$line" | xmllint --format - \