summaryrefslogtreecommitdiffstats
path: root/courgette/stress_test_common
blob: b6c9b25e8886567cda17bba240ef7337a3cce611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# Emit an error message
error() {
  echo "error: ${@}" >&2
}

# Given a token, search for and count the instances of lines from the
# logfile that start with the token.
count_result() {
  if [ ! -z "${1}" ]; then
    echo $(cat "${log}" | grep "^${1} " | wc -l)    
  else
    echo 0
  fi
}