Skip to content

Commit

Permalink
Merge pull request #5 from canonical/update_pod_configuration
Browse files Browse the repository at this point in the history
Changed namespace
  • Loading branch information
dmitry-ratushnyy authored Apr 22, 2024
2 parents f61677c + 1f7f016 commit 23e336d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mongodb-benchmarking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb-benchmarking
namespace: perf-test
namespace: benchmarking
labels:
app: mongodb-benchmarking
spec:
Expand Down
28 changes: 17 additions & 11 deletions scripts/ycsb_load_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ ln -sf /usr/bin/python2.7 /usr/bin/python
export PATH="/usr/lib/jvm/java-21-openjdk-amd64/bin/:/usr/share/maven/bin/:$PATH"

# Default values
RECORD_COUNT_DEFAULT=500000
LOAD_THREADS_COUNT_DEFAULT=16
MONGODB_URI_DEFAULT="mongodb://localhost:21017/admin?replicaSet=mongodb"
WORKLOAD_DEFAULT="workloada"
RECORD_COUNT=500000
LOAD_THREADS_COUNT=16
MONGODB_URI="mongodb://localhost:21017/admin?replicaSet=mongodb-k8s"
WORKLOAD="workloada"

# Read parameters or use defaults
WORKLOAD=${1:-$WORKLOAD_DEFAULT}
RECORD_COUNT=${2:-$RECORD_COUNT_DEFAULT}
LOAD_THREADS_COUNT=${3:-$LOAD_THREADS_COUNT_DEFAULT}
MONGODB_URI=${4:-$MONGODB_URI_DEFAULT}
# Parse named arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
-w|--workload) WORKLOAD="$2"; shift ;;
-rc|--record-count) RECORD_COUNT="$2"; shift ;;
-lt|--load-threads-count) LOAD_THREADS_COUNT="$2"; shift ;;
-mu|--mongodb-uri) MONGODB_URI="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done

# Run YCSB with specified parameters
/var/load-testing/ycsb-0.17.0/bin/ycsb \
load mongodb -s \
-P "/var/load-testing/ycsb-0.17.0/workloads/$WORKLOAD" \
-p recordcount=$RECORD_COUNT \
-threads $LOAD_THREADS_COUNT \
-p mongodb.url="$MONGODB_URI"

-p mongodb.url="$MONGODB_URI"
23 changes: 13 additions & 10 deletions scripts/ycsb_run_operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
ln -sf /usr/bin/python2.7 /usr/bin/python
export PATH="/usr/lib/jvm/java-21-openjdk-amd64/bin/:/usr/share/maven/bin/:$PATH"

# Default values
OPERATIONS_COUNT=1000000
OPERATIONS_THREADS_COUNT=2
MONGODB_URI_DEFAULT="mongodb://localhost:21017/admin?replicaSet=mongodb"
WORKLOAD_DEFAULT="workloada"

# Read parameters or use defaults
WORKLOAD=${1:-$WORKLOAD_DEFAULT}
RECORD_COUNT=${2:-$RECORD_COUNT_DEFAULT}
LOAD_THREADS_COUNT=${3:-$LOAD_THREADS_COUNT_DEFAULT}
MONGODB_URI=${4:-$MONGODB_URI_DEFAULT}

MONGODB_URI="mongodb://localhost:21017/admin?replicaSet=mongodb-k8s"
WORKLOAD="workloada"

# Parse named arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
-w|--workload) WORKLOAD="$2"; shift ;;
-oc|--operations-count) OPERATIONS_COUNT="$2"; shift ;;
-ot|--operations-threads-count) OPERATIONS_THREADS_COUNT="$2"; shift ;;
-mu|--mongodb-uri) MONGODB_URI="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done

/var/load-testing/ycsb-0.17.0/bin/ycsb \
run mongodb -s \
Expand Down

0 comments on commit 23e336d

Please sign in to comment.