7a1bb6c0e261fe4095f2dad1b229ac4742ca9e2e
3 ### The -t argument permit to specify the type of task that you want to benchmark.
4 ### Supported values are CPU_INTENSIVE, IO_INTENSIVE
5 ### The -s argument permit to specify the size of task that you want to benchmark.
8 echo "Usage: $0 [-t <CPU_INTENSIVE|IO_INTENSIVE>] [-s <number of tasks>]" 1>&2
12 taskType
='CPU_INTENSIVE'
14 while getopts "t:s:h" option
24 echo "Error: Missing option argument for '-${OPTARG}'" >&2;
29 echo "Error: Unknown or invalid option for '-${OPTARG}'" >&2;
38 echo 'Running benchmarks for task type:' ${taskType} 'and task size:' ${taskSize}
39 export TASK_TYPE
=${taskType}
40 export TASK_SIZE
=${taskSize}
42 export NODE_ENV
=production
44 export NUM_ITERATIONS
=100000
47 caffeinate .
/hyperfine_benchmarks.sh
50 systemd-inhibit .
/hyperfine_benchmarks.sh
53 echo "Unsupported $OSTYPE"