-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added TestExport to avoid creating unstructured json, fixes #860
- Loading branch information
Showing
25 changed files
with
826 additions
and
461 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/data/ExperimentProfile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/data/TestExport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package io.hyperfoil.tools.horreum.api.data; | ||
|
||
import io.hyperfoil.tools.horreum.api.alerting.MissingDataRule; | ||
import io.hyperfoil.tools.horreum.api.alerting.Variable; | ||
import io.hyperfoil.tools.horreum.api.alerting.Watch; | ||
|
||
import java.util.List; | ||
|
||
public class TestExport extends Test { | ||
|
||
public List<Variable> variables; | ||
public List<MissingDataRule> missingDataRules; | ||
public List<ExperimentProfile> experiments; | ||
public List<Action> actions; | ||
public Watch subscriptions; | ||
|
||
public TestExport() { | ||
super(); | ||
} | ||
public TestExport(Test t) { | ||
super(t); | ||
} | ||
|
||
//need to propagate the changes to newTest into the existing properties | ||
public void update(Test newTest) { | ||
id = newTest.id; | ||
} | ||
|
||
public void updateRefs() { | ||
//need to make sure the correct variables are used by experiments | ||
if(variables != null && !variables.isEmpty()) | ||
variables.forEach(variable -> variable.testId = id); | ||
|
||
if(experiments != null && !experiments.isEmpty()) { | ||
for(ExperimentProfile experiment : experiments) { | ||
experiment.testId = id; | ||
} | ||
} | ||
if(actions != null && !actions.isEmpty()) { | ||
for(Action action : actions) { | ||
action.testId = id; | ||
} | ||
} | ||
if(subscriptions != null) { | ||
subscriptions.testId = id; | ||
} | ||
if(missingDataRules != null && !missingDataRules.isEmpty()) { | ||
for(MissingDataRule rule : missingDataRules) { | ||
rule.testId = id; | ||
} | ||
} | ||
} | ||
public void updateExperimentsVariableId(int oldVarId, int newVarId) { | ||
if(experiments != null && !experiments.isEmpty()) { | ||
for(ExperimentProfile experiment : experiments) { | ||
if(experiment.comparisons != null && !experiment.comparisons.isEmpty()) { | ||
experiment.comparisons.forEach(c -> { | ||
if(c.variableId == oldVarId) | ||
c.variableId = newVarId; | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.