Search in sources :

Example 31 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class TestTreeFilter method getTree.

public CallTreeNode getTree() throws IOException, XmlPullParserException, InterruptedException, FileNotFoundException, ViewNotFoundException, AnalysisConfigurationException {
    final MeasurementConfig config = new MeasurementConfig(1, new ExecutionConfig(15), new KiekerConfig(true));
    config.getStatisticsConfig().setOutlierFactor(18);
    TreeReader executor = TreeReaderFactory.createTestTreeReader(projectFolder, config, new EnvironmentVariables());
    TestCase test = new TestCase("defaultpackage.TestMe", "testMe");
    // executor.executeKoPeMeKiekerRun(new TestSet(test), "1");
    CallTreeNode node = executor.getTree(test, "1");
    return node;
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) TreeReader(de.dagere.peass.measurement.rca.kieker.TreeReader) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig)

Example 32 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class KiekerEnvironmentPreparer method prepareKieker.

public void prepareKieker() throws IOException, InterruptedException {
    final MeasurementConfig config = testTransformer.getConfig();
    KiekerConfig kiekerConfig = config.getKiekerConfig();
    if (kiekerConfig.isUseSourceInstrumentation() && !kiekerConfig.isOnlyOneCallRecording()) {
        instrumentSources(config);
    } else {
        if (kiekerConfig.isEnableAdaptiveMonitoring()) {
            prepareAdaptiveExecution();
        }
        if (kiekerConfig.isOnlyOneCallRecording()) {
            generateAOPXML("de.dagere.kopeme.kieker.probe.OneCallAspectFull");
        } else if (AllowedKiekerRecord.DURATION.equals(kiekerConfig.getRecord())) {
            generateAOPXML(AllowedKiekerRecord.DURATION.getFullName());
        } else {
            generateAOPXML(AllowedKiekerRecord.OPERATIONEXECUTION.getFullName());
        }
    }
    generateKiekerMonitoringProperties();
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig)

Example 33 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class TestTraceMethodReader method testTraceLengthLongFor.

@Test
public void testTraceLengthLongFor() throws ParseException, IOException {
    String jarPath = getJarPath();
    String agentPath = getAgentPath();
    final ProcessBuilder builder = new ProcessBuilder("java", "-javaagent:" + agentPath, "-Dorg.aspectj.weaver.loadtime.configuration=file:src" + File.separator + "test" + File.separator + "resources" + File.separator + "aop.xml", "-cp", jarPath, "de.peass.example.CallerLongFor");
    final Process process = builder.start();
    StreamGobbler.showFullProcess(process);
    final File[] kiekerFolders = tmpFolder.listFiles((FileFilter) new WildcardFileFilter("kieker-*"));
    final File traceFolder = kiekerFolders[0];
    final TraceMethodReader reader = new TraceMethodReader(new CalledMethodLoader(traceFolder, ModuleClassMapping.SINGLE_MODULE_MAPPING, new KiekerConfig()).getShortTrace(""), new File("src" + File.separator + "test" + File.separator + "java"));
    final TraceWithMethods trace = reader.getTraceWithMethods();
    System.out.println(trace.getWholeTrace());
    Assert.assertEquals(7, trace.getLength());
}
Also used : TraceWithMethods(de.dagere.peass.dependency.traces.TraceWithMethods) File(java.io.File) WildcardFileFilter(org.apache.commons.io.filefilter.WildcardFileFilter) TraceMethodReader(de.dagere.peass.dependency.traces.TraceMethodReader) KiekerConfig(de.dagere.peass.config.KiekerConfig) CalledMethodLoader(de.dagere.peass.dependency.analysis.CalledMethodLoader) Test(org.junit.jupiter.api.Test)

Example 34 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class TestKiekerEnvironmentPreparer method testFullAopXMLGeneration.

@Test
public void testFullAopXMLGeneration() throws IOException, InterruptedException {
    List<File> modules = new LinkedList<File>();
    modules.add(DependencyTestConstants.CURRENT);
    KiekerConfig kiekerConfig = new KiekerConfig(true);
    kiekerConfig.setUseSourceInstrumentation(false);
    KiekerEnvironmentPreparer kiekerEnvironmentPreparer = new KiekerEnvironmentPreparer(null, Arrays.asList("defaultpackage.NormalDependency"), new PeassFolders(DependencyTestConstants.CURRENT), new JUnitTestTransformer(DependencyTestConstants.CURRENT, new ExecutionConfig(10), kiekerConfig), modules);
    kiekerEnvironmentPreparer.prepareKieker();
    checkAopCorrectness();
}
Also used : KiekerEnvironmentPreparer(de.dagere.peass.execution.kieker.KiekerEnvironmentPreparer) JUnitTestTransformer(de.dagere.peass.testtransformation.JUnitTestTransformer) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) LinkedList(java.util.LinkedList) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Aggregations

KiekerConfig (de.dagere.peass.config.KiekerConfig)34 PeassFolders (de.dagere.peass.folders.PeassFolders)22 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)21 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)21 File (java.io.File)21 Test (org.junit.jupiter.api.Test)18 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)9 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)7 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)7 ChangeManager (de.dagere.peass.dependency.ChangeManager)5 CalledMethodLoader (de.dagere.peass.dependency.analysis.CalledMethodLoader)5 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)5 TraceElement (de.dagere.peass.dependency.analysis.data.TraceElement)5 ResultsFolders (de.dagere.peass.folders.ResultsFolders)5 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)5 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)4 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)4 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)4 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)4 VersionIterator (de.dagere.peass.vcs.VersionIterator)4