Commit c2741fef authored by Daniel Seybold's avatar Daniel Seybold

fixed and extended gibbon tasks logging

parent ffd1ae5d
Pipeline #53613 passed with stage
in 9 minutes and 50 seconds
......@@ -26,10 +26,11 @@ def plot_timeseries():
parser = argparse.ArgumentParser(description='Plot timeseries and averages of different phases based on YCSB result files.')
parser.add_argument('--runFolder', '-rf',type=str, nargs=1,required=True, help='path to the evalation_run_XXX folder')
parser.add_argument('--scenario', '-s',type=str, nargs=1,required=True, choices=['elasticity', 'availability'], help='type of the evaluation scenario: elasticity/availability')
parser.add_argument('--workloadPhase', '-wp',type=str, nargs=1,required=True, choices=['load', 'transaction'], help='type of the workload phase: load/transaction')
parser.add_argument('--scaleDelay', '-sd',type=int, nargs='?',const=0, help='delay in seconds before scaling action was triggered')
parser.add_argument('--gibbonDelay', '-gd',type=int, nargs='?',const=0, help='delay in seconds before triggering the failure injection via Gibbon')
parser.add_argument('--recoveryAction', '-ra', action='store_true', help='flag that indicates if recovery action was executed')
parser.add_argument('--recoveryDelay', '-rd',type=int,nargs='?',const=0, help='delay in seconds before triggering the recovery action')
#parser.add_argument('--gibbonDelay', '-gd',type=int, nargs='?',const=0, help='delay in seconds before triggering the failure injection via Gibbon')
#parser.add_argument('--recoveryAction', '-ra', action='store_true', help='flag that indicates if recovery action was executed')
#parser.add_argument('--recoveryDelay', '-rd',type=int,nargs='?',const=0, help='delay in seconds before triggering the recovery action')
args = parser.parse_args()
inputPath = args.runFolder[0]
......@@ -50,29 +51,33 @@ def plot_timeseries():
elif scenario == 'availability':
print("creating availability phase plots...")
gibbonDelay = args.gibbonDelay
recoveryAction = args.recoveryAction
recoveryDelay = args.recoveryDelay
workloadPhase = "load"
#gibbonDelay = args.gibbonDelay
#recoveryAction = args.recoveryAction
#recoveryDelay = args.recoveryDelay
df = getPhasesDataframe(inputPath,workloadPhase)
print(df)
if recoveryAction:
print("plotting availability phases with recovery!")
deployVmDuration, scaleOutDuration = getPhaseDurations(inputPath)
gibbonDuration = getGibbonPhaseDuration(inputPath)
gibbonEnd = gibbonDelay + gibbonDuration
#if recoveryAction:
# print("plotting availability phases with recovery!")
# deployVmDuration, scaleOutDuration = getPhaseDurations(inputPath)
#
# gibbonDuration = getGibbonPhaseDuration(inputPath)
# gibbonEnd = gibbonDelay + gibbonDuration
recoveryStart = gibbonEnd + recoveryDelay
# recoveryStart = gibbonEnd + recoveryDelay
recoveryEnd = recoveryStart + deployVmDuration + scaleOutDuration
# recoveryEnd = recoveryStart + deployVmDuration + scaleOutDuration
plot_availability_recovery_throughput_timeseries(inputPath, gibbonDelay, gibbonEnd, recoveryStart, recoveryEnd)
# plot_availability_recovery_throughput_timeseries(inputPath, gibbonDelay, gibbonEnd, recoveryStart, recoveryEnd)
else:
print("plotting availability phases without recovery!")
gibbonDuration = getGibbonPhaseDuration(inputPath)
gibbonEnd = gibbonDelay + gibbonDuration
#else:
# print("plotting availability phases without recovery!")
# gibbonDuration = getGibbonPhaseDuration(inputPath)
# gibbonEnd = gibbonDelay + gibbonDuration
plot_availability_no_recovery_throughput_timeseries(inputPath, gibbonDelay, gibbonEnd)
# plot_availability_no_recovery_throughput_timeseries(inputPath, gibbonDelay, gibbonEnd)
print("finished evaluation metrics plotting!")
......@@ -441,5 +446,59 @@ def getGibbonPhaseDuration(inputPath):
return gibbonDuration
def getPhasesDataframe(inputPath, workloadPhase):
inputPath = inputPath + plotting_config.TASK_FOLDER + plotting_config.TASK_LOG_FILE
file = open(inputPath, 'r', encoding='utf8')
colNames =['GibbonStart','GibbonEnd','InjectFailureStart', 'InjectFailureEnd']
df = pd.DataFrame(columns = colNames)
indexCounter = 0
try:
for line in file:
line = line.rstrip()
if "GIBBON" in line and "STARTED" in line:
splittedLine = line.split(";")
GibbonStart = splittedLine[1]
GibbonStart = GibbonStart.replace('s','')
GibbonStart = int(GibbonStart)
df.loc[indexCounter,'GibbonStart'] = GibbonStart
if "INJECT_FAILURE" in line and "STARTED" in line:
splittedLine = line.split(";")
InjectStart = splittedLine[1]
InjectStart = InjectStart.replace('s','')
InjectStart = int(InjectStart)
df.loc[indexCounter,'InjectFailureStart'] = InjectStart
if "INJECT_FAILURE" in line and "FINISHED" in line:
splittedLine = line.split(";")
InjectEnd = splittedLine[1]
InjectEnd = InjectEnd.replace('s','')
InjectEnd = int(InjectEnd)
df.loc[indexCounter,'InjectFailureEnd'] = InjectEnd
if "GIBBON" in line and "FINISHED" in line:
splittedLine = line.split(";")
GibbonEnd = splittedLine[1]
GibbonEnd = GibbonEnd.replace('s','')
GibbonEnd = int(GibbonEnd)
df.loc[indexCounter,'GibbonEnd'] = GibbonEnd
indexCounter = indexCounter + 1
except UnicodeDecodeError:
print("Skipping line! Unable to decode line due to UnicodeDecodeError!")
print(df)
return df
#init function call
plot_timeseries()
\ No newline at end of file
......@@ -72,6 +72,7 @@ public class GibbonV2 extends EvaluationTask {
int counter = 0;
boolean check = false;
for (GibbonSpec gibbonSpec: this.gibbonSpecs ) {
new LogTask(evaluationContext, TaskType.GIBBON, TaskState.STARTED).call();
//1. log GibbonSpec to disk
writeGibbonSpec(counter,gibbonSpec);
......@@ -83,14 +84,14 @@ public class GibbonV2 extends EvaluationTask {
}
//3. inject failure
new LogTask(evaluationContext, TaskType.GIBBON, TaskState.STARTED);
new LogTask(evaluationContext, TaskType.INJECT_FAILURE, TaskState.STARTED).call();
try {
GibbonAlgorithm.injectFailure(appInstanceId, gibbonSpec);
}catch (Exception e){
LOGGER.error(loggerPrefix + "error while executing the GibbonAlgorithm algorithm!" ,e);
return new DefaultWorkReport(WorkStatus.FAILED);
}
new LogTask(evaluationContext, TaskType.GIBBON, TaskState.FINISHED);
new LogTask(evaluationContext, TaskType.INJECT_FAILURE, TaskState.FINISHED).call();
//4. wait for recoveryDelay
check = this.gibbonDelayWait(gibbonSpec.getRecoveryDelay());
......@@ -109,8 +110,9 @@ public class GibbonV2 extends EvaluationTask {
}
}
counter++;
new LogTask(evaluationContext, TaskType.GIBBON, TaskState.FINISHED).call();
}
......@@ -166,19 +168,19 @@ public class GibbonV2 extends EvaluationTask {
//wait until VM is created
LOGGER.debug(loggerPrefix + "Waiting for VM creation");
new LogTask(evaluationContext, TaskType.SPAWN_VM, TaskState.STARTED).call();
new LogTask(evaluationContext, TaskType.RECOVERY_SPAWN_VM, TaskState.STARTED).call();
if(!checkIfVmIsReady(scaleOutVm)){
LOGGER.debug(loggerPrefix + "Create scale-out VM failed!");
return false;
}
new LogTask(evaluationContext, TaskType.SPAWN_VM, TaskState.FINISHED).call();
new LogTask(evaluationContext, TaskType.RECOVERY_SPAWN_VM, TaskState.FINISHED).call();
//wait until DBMS is deployed on VM
LOGGER.debug(loggerPrefix + "Waiting for Instance creation!");
new LogTask(evaluationContext, TaskType.DEPLOY_DB, TaskState.STARTED).call();
new LogTask(evaluationContext, TaskType.RECOVERY_DEPLOY_DB, TaskState.STARTED).call();
waitUntilInstanceIsReady(scaleOutInstance);
new LogTask(evaluationContext, TaskType.DEPLOY_DB, TaskState.FINISHED).call();
new LogTask(evaluationContext, TaskType.RECOVERY_DEPLOY_DB, TaskState.FINISHED).call();
LOGGER.info(loggerPrefix + "Scale-out successful, created new component instance with ID: " + scaleOutInstance.getId());
......
......@@ -13,6 +13,9 @@ public enum TaskType {
YCSB_TRANSACTION,
TPCC,
GIBBON,
INJECT_FAILURE,
RECOVERY_SPAWN_VM,
RECOVERY_DEPLOY_DB,
DELAY,
SCALE,
CHECK_WORKLOAD,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment