Skip to content
Snippets Groups Projects
Commit c25b709a authored by Nikolaus Huber's avatar Nikolaus Huber
Browse files

git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/code/DMM/trunk@12282 9e42b895-fcda-4063-8a3b-11be15eb1bbd
parent 65a51d21
No related branches found
No related tags found
No related merge requests found
...@@ -196,7 +196,7 @@ public class AdaptationControl { ...@@ -196,7 +196,7 @@ public class AdaptationControl {
else { else {
// Check if tactic has made anything stupid, i.e., violates the objectives. If yes, undo // Check if tactic has made anything stupid, i.e., violates the objectives. If yes, undo
// and/or assign bad weight. // and/or assign bad weight.
if (evaluator.qosDegradationDetected(tactic)) { if (evaluator.slaViolated(tactic)) {
logger.warn("QoS degradation detected after applying tactic " + tactic.getName()); logger.warn("QoS degradation detected after applying tactic " + tactic.getName());
executor.undoPreviousTactic(); executor.undoPreviousTactic();
evaluator.punishTactic(tactic); evaluator.punishTactic(tactic);
......
...@@ -26,7 +26,7 @@ public interface IEvaluator { ...@@ -26,7 +26,7 @@ public interface IEvaluator {
* @param tactic * @param tactic
* @return * @return
*/ */
public boolean qosDegradationDetected(WeightedTactic tactic); public boolean slaViolated(WeightedTactic tactic);
/** /**
* Reduces the weight of the given tactic. * Reduces the weight of the given tactic.
......
...@@ -56,7 +56,7 @@ public class WeightingFunctionEvaluator implements IEvaluator { ...@@ -56,7 +56,7 @@ public class WeightingFunctionEvaluator implements IEvaluator {
tactic.setCurrentWeight(newWeight); tactic.setCurrentWeight(newWeight);
} }
public boolean qosDegradationDetected(WeightedTactic tactic) { public boolean slaViolated(WeightedTactic tactic) {
Impact impact = tactic.getLastImpact(); Impact impact = tactic.getLastImpact();
Result before = impact.getBefore(); Result before = impact.getBefore();
Result after = impact.getAfter(); Result after = impact.getAfter();
......
...@@ -5,7 +5,8 @@ import edu.kit.ipd.descartes.mm.adaptation.WeightedTactic; ...@@ -5,7 +5,8 @@ import edu.kit.ipd.descartes.mm.adaptation.WeightedTactic;
public class BlueYonderExperimentTracker implements IObserver { public class BlueYonderExperimentTracker implements IObserver {
private static final String RESULT_NAME = "Xreq-par-$1Yps-desc4-gw-desc3-db-desc2-predict-Z ps=$2-req=5-size=50000"; private static final String RESULT_NAME_TEMPLATE = "Xreq-par-$1Yps-desc4-gw-desc3-db-desc2-predict-Z ps=$2-req=5-size=50000";
// private static final String RESULT_NAME_TEMPLATE = "Xreq-par-$1Yps-desc4-gw-desc3-db-desc2-predict-Z ps=$2-req=40-size=500000";
private static BlueYonderExperimentTracker instance = null; private static BlueYonderExperimentTracker instance = null;
private int psOnDescOne = 0; private int psOnDescOne = 0;
private int psOnDescFour = 1; private int psOnDescFour = 1;
...@@ -17,12 +18,12 @@ public class BlueYonderExperimentTracker implements IObserver { ...@@ -17,12 +18,12 @@ public class BlueYonderExperimentTracker implements IObserver {
} }
public String getCurrentExperimentName() { public String getCurrentExperimentName() {
String result = RESULT_NAME; String result = RESULT_NAME_TEMPLATE;
if (psOnDescOne > 0) if (psOnDescOne > 0)
result = RESULT_NAME.replace("$1", psOnDescOne + "ps-desc1-"); result = RESULT_NAME_TEMPLATE.replace("$1", psOnDescOne + "ps-desc1-");
else else
result = RESULT_NAME.replace("$1", ""); result = RESULT_NAME_TEMPLATE.replace("$1", "");
result = result.replace("$2", Integer.toString(psOnDescFour)); result = result.replace("$2", Integer.toString(psOnDescFour));
return result; return result;
...@@ -43,14 +44,16 @@ public class BlueYonderExperimentTracker implements IObserver { ...@@ -43,14 +44,16 @@ public class BlueYonderExperimentTracker implements IObserver {
} }
} else if (execTacticName.contains("Low")) { } else if (execTacticName.contains("Low")) {
psOnDescOne++; psOnDescOne++;
assert psOnDescFour > 0; if (execTacticName.contains("Migrate")) {
if (execTacticName.contains("Migrate")) assert psOnDescFour > 0;
psOnDescFour--; psOnDescFour--;
}
} else if (execTacticName.contains("High")) { } else if (execTacticName.contains("High")) {
psOnDescFour++; psOnDescFour++;
assert psOnDescOne > 0; if (execTacticName.contains("Migrate")) {
if (execTacticName.contains("Migrate")) assert psOnDescOne > 0;
psOnDescOne--; psOnDescOne--;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment