From d580a5253cb6f9dd2528ca8c9ce1cfa6b6f96478 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <post@soeren-henning.de>
Date: Sun, 19 Apr 2020 11:07:32 +0200
Subject: [PATCH] Prepare configurable execution duration

---
 execution/lag_analysis.py | 3 ++-
 execution/run_uc1-new.sh  | 3 ++-
 execution/run_uc2-new.sh  | 3 ++-
 execution/run_uc3-new.sh  | 3 ++-
 execution/run_uc4-new.sh  | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/execution/lag_analysis.py b/execution/lag_analysis.py
index 40dbe6180..d8c2dc230 100644
--- a/execution/lag_analysis.py
+++ b/execution/lag_analysis.py
@@ -11,6 +11,7 @@ exp_id =  sys.argv[1]
 benchmark = sys.argv[2]
 dim_value = sys.argv[3]
 instances = sys.argv[4]
+execution_minutes = 5
 time_diff_ms = int(os.getenv('CLOCK_DIFF_MS', 0))
 
 #http://localhost:9090/api/v1/query_range?query=sum%20by(job,topic)(kafka_consumer_consumer_fetch_manager_metrics_records_lag)&start=2015-07-01T20:10:30.781Z&end=2020-07-01T20:11:00.781Z&step=15s
@@ -21,7 +22,7 @@ print(f"Now Local: {now_local}")
 print(f"Now Used: {now}")
 
 end = now
-start = now - timedelta(minutes=5)
+start = now - timedelta(minutes=execution_minutes)
 
 #print(start.isoformat().replace('+00:00', 'Z'))
 #print(end.isoformat().replace('+00:00', 'Z'))
diff --git a/execution/run_uc1-new.sh b/execution/run_uc1-new.sh
index 1029dee49..540f752b8 100755
--- a/execution/run_uc1-new.sh
+++ b/execution/run_uc1-new.sh
@@ -4,6 +4,7 @@ EXP_ID=$1
 DIM_VALUE=$2
 INSTANCES=$3
 PARTITIONS=$4
+EXECUTION_MINUTES=5
 
 # Start up Kafka
 # TODO
@@ -26,7 +27,7 @@ kubectl apply -f uc1-application/aggregation-deployment.yaml
 kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS
 
 # Execute for certain time
-sleep 5m
+sleep ${EXECUTION_MINUTES}m
 
 # Run eval script
 source ../.venv/bin/activate
diff --git a/execution/run_uc2-new.sh b/execution/run_uc2-new.sh
index 8383e602e..6742a7316 100755
--- a/execution/run_uc2-new.sh
+++ b/execution/run_uc2-new.sh
@@ -4,6 +4,7 @@ EXP_ID=$1
 DIM_VALUE=$2
 INSTANCES=$3
 PARTITIONS=$4
+EXECUTION_MINUTES=5
 
 # Maybe start up Kafka
 
@@ -23,7 +24,7 @@ kubectl apply -f uc2-application/aggregation-deployment.yaml
 kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS
 
 # Execute for certain time
-sleep 5m
+sleep ${EXECUTION_MINUTES}m
 
 # Run eval script
 source ../.venv/bin/activate
diff --git a/execution/run_uc3-new.sh b/execution/run_uc3-new.sh
index 24353fdf2..c5c0f9eba 100755
--- a/execution/run_uc3-new.sh
+++ b/execution/run_uc3-new.sh
@@ -4,6 +4,7 @@ EXP_ID=$1
 DIM_VALUE=$2
 INSTANCES=$3
 PARTITIONS=$4
+EXECUTION_MINUTES=5
 
 # Maybe start up Kafka
 
@@ -23,7 +24,7 @@ kubectl apply -f uc3-application/aggregation-deployment.yaml
 kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS
 
 # Execute for certain time
-sleep 5m
+sleep ${EXECUTION_MINUTES}m
 
 # Run eval script
 source ../.venv/bin/activate
diff --git a/execution/run_uc4-new.sh b/execution/run_uc4-new.sh
index c3774bb9e..e000c7b2b 100755
--- a/execution/run_uc4-new.sh
+++ b/execution/run_uc4-new.sh
@@ -4,6 +4,7 @@ EXP_ID=$1
 DIM_VALUE=$2
 INSTANCES=$3
 PARTITIONS=$4
+EXECUTION_MINUTES=10
 
 # Maybe start up Kafka
 
@@ -23,7 +24,7 @@ kubectl apply -f uc4-application/aggregation-deployment.yaml
 kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS
 
 # Execute for certain time
-sleep 5m
+sleep ${EXECUTION_MINUTES}m
 
 # Run eval script
 source ../.venv/bin/activate
-- 
GitLab