Skip to content

Instantly share code, notes, and snippets.

@real34
real34 / load-test.sh
Last active November 30, 2020 09:57 — forked from bigomega/load-test.sh
A simple bash script to do load (performance) testing of a web service
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
curl -s -o /dev/null -w %{http_code} --max-time 3 "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
@real34
real34 / score.exs
Last active December 30, 2015 04:59 — forked from chadrien/score.rb
# encoding: UTF-8
defmodule Score do
@missed "-"
@spare "/"
@strike "X"
def total(rolls) when is_bitstring(rolls) do
rolls |> String.codepoints |> total