Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move full cycle mini test to full cycle with shared params #169

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 89 additions & 0 deletions scripts/full_cycle/full_cycle_timescaledb.sh
@@ -0,0 +1,89 @@
#!/bin/bash -x
# showcases the ftsb 3 phases for timescaledb
# - 1) data and query generation
# - 2) data loading/insertion
# - 3) query execution

# Auth

PORT=5432
USER=postgres
PASSWORD=password
HOST=0.0.0.0
DATABASE_NAME=${DATABASE_NAME:-"benchmark"}


CONTAINER_NAME=timescaledb_benchmark
# setup pg with password and expose the default port.
sudo docker run -d --name $CONTAINER_NAME -p 5432:$PORT \
-e POSTGRES_PASSWORD=$PASSWORD \
timescale/timescaledb:latest-pg12

docker start $CONTAINER_NAME
sleep 2
Comment on lines +18 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we wrap this in a check in case we're not running this locally?



# Setup
USE_CASE=${USE_CASE:-"cpu-only"}
QUERY_TYPES=(lastpoint cpu-max-all-1 high-cpu-1)
SCALE=10
SEED=123
WORKERS=1
MAX_QUERIES=${MAX_QUERIES:-"1000"}

# Folders setup

TARGET_DATA_FOLDER=${TARGET_DATA_FOLDER:-"/tmp/bulk_data"}
DATA_FILE=$TARGET_DATA_FOLDER/timescaledb_data
mkdir -p $TARGET_DATA_FOLDER


# generate queries
$GOPATH/bin/tsbs_generate_data \
--format timescaledb \
--use-case $USE_CASE \
--scale $SCALE \
--seed $SEED \
--file $DATA_FILE

for _type in "${QUERY_TYPES[@]}"
do
:
$GOPATH/bin/tsbs_generate_queries \
--format timescaledb \
--queries ${MAX_QUERIES} \
--use-case $USE_CASE \
--scale $SCALE \
--seed $SEED \
--query-type $_type \
--file $TARGET_DATA_FOLDER/timescaledb_query_$_type
done

# insert benchmark
$GOPATH/bin/tsbs_load_timescaledb \
--pass=${PASSWORD} \
--postgres="sslmode=disable port=${PORT}" \
--db-name=${DATABASE_NAME} \
--host=${HOST} \
--user=${USER} \
--workers=${WORKERS} \
--file=${DATA_FILE}


for _type in "${QUERY_TYPES[@]}"
do
:
# queries benchmark
$GOPATH/bin/tsbs_run_queries_timescaledb \
--max-queries=${MAX_QUERIES} \
--pass=${PASSWORD} \
--postgres="sslmode=disable port=${PORT}" \
--db-name=${DATABASE_NAME} \
--hosts=${HOST} \
--user=${USER} \
--workers=${WORKERS} \
--file=$TARGET_DATA_FOLDER/timescaledb_query_$_type
done

# only because you're going to do benchmarks and don't wanto to persist it
sudo docker rm -f $(sudo docker ps -aq --filter name=$CONTAINER_NAME)
27 changes: 0 additions & 27 deletions scripts/full_cycle_minitest/full_cycle_minitest_timescaledb.sh

This file was deleted.