From c2a1820233f338bd163dc2af098a191542483d68 Mon Sep 17 00:00:00 2001
From: Krzysztof Mochocki <kmochocki@syncad.com>
Date: Thu, 4 Aug 2022 15:41:44 +0200
Subject: [PATCH] Add script to setup jmeter

---
 benchmarks/setup_jmeter.bash | 38 ++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 benchmarks/setup_jmeter.bash

diff --git a/benchmarks/setup_jmeter.bash b/benchmarks/setup_jmeter.bash
new file mode 100644
index 00000000..d415d770
--- /dev/null
+++ b/benchmarks/setup_jmeter.bash
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -euo pipefail
+
+WORKDIR=jmeter
+JMETER_DOWNLOAD_URL="https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.4.3.zip"
+JMETER_POSTGRES_DOWNLOAD_URL="https://jdbc.postgresql.org/download/postgresql-42.3.1.jar"
+
+echo "creating work directory"
+mkdir -p "$WORKDIR"
+
+pushd "$WORKDIR"
+
+echo "downloading jmeter"
+wget --quiet "$JMETER_DOWNLOAD_URL" > /dev/null
+
+echo "unzipping jmeter"
+unzip -qq apache-*.zip > /dev/null
+
+echo "removing archive and renaming jmeter directory"
+rm apache-*.zip
+mv apache* apache
+
+    pushd apache
+        pushd lib
+                echo "downloading postgres driver for jmeter"
+                wget --quiet "$JMETER_POSTGRES_DOWNLOAD_URL" > /dev/null
+        popd
+
+        export JMETER="$PWD/bin/jmeter"
+    popd
+
+    echo "For handy usage, execute following command"
+    echo "echo 'export JMETER=$JMETER' >> ~/.bashrc"
+
+    echo "testing is jmeter properly configured"
+    $JMETER --version && echo "ok."
+popd
-- 
GitLab