Search in sources :

Example 51 with GCResource

use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.

the class TestGCViewerArgsParser method gcSeriesAndExportFile.

@Test
public void gcSeriesAndExportFile() throws Exception {
    String[] args = { "some_gc.log.0;some_gc.log.1;some_gc.log.2", "export_to.csv" };
    GCViewerArgsParser gcViewerArgsParser = new GCViewerArgsParser();
    gcViewerArgsParser.parseArguments(args);
    assertEquals(gcViewerArgsParser.getArgumentCount(), 2);
    List<GCResource> resources = Arrays.asList(new GcResourceFile("some_gc.log.0"), new GcResourceFile("some_gc.log.1"), new GcResourceFile("some_gc.log.2"));
    assertEquals(gcViewerArgsParser.getGcResource(), new GcResourceSeries(resources));
    assertEquals(gcViewerArgsParser.getSummaryFilePath(), "export_to.csv");
    assertEquals(gcViewerArgsParser.getType(), DataWriterType.SUMMARY);
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Example 52 with GCResource

use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.

the class GCModelLoaderFactoryTest method createFor_GcResourceSeries.

@Test
public void createFor_GcResourceSeries() throws Exception {
    GCResource gcResource = mock(GcResourceSeries.class);
    assertThat(GCModelLoaderFactory.createFor(gcResource), instanceOf(GCModelSeriesLoaderImpl.class));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) Test(org.junit.Test)

Example 53 with GCResource

use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.

the class GCModelSeriesLoaderImplTest method getGcResource.

@Test
public void getGcResource() throws Exception {
    ArrayList<GCResource> gcResourceList = new ArrayList<>();
    gcResourceList.add(new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part1.txt").getPath()));
    gcResourceList.add(new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part2.txt").getPath()));
    gcResourceList.add(new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part3.txt").getPath()));
    GCModelLoader loader = new GCModelSeriesLoaderImpl(new GcResourceSeries(gcResourceList));
    assertThat(loader.getGcResource(), notNullValue());
}
Also used : GCModelLoader(com.tagtraum.perf.gcviewer.ctrl.GCModelLoader) GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Example 54 with GCResource

use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.

the class ChartPanelView method propertyChange.

@Override
public void propertyChange(PropertyChangeEvent evt) {
    // TODO if there were parser warnings, change color of parser tab
    if (evt.getSource() instanceof GCResource && GcResourceFile.PROPERTY_MODEL.equals(evt.getPropertyName())) {
        GCResource gcResource = (GCResource) evt.getSource();
        updateModel(gcResource);
        updateTabDisplay(gcResource);
    }
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource)

Example 55 with GCResource

use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.

the class TestDataReaderFacade method testLoadModelFromSeries.

@Test
public void testLoadModelFromSeries() throws IOException, DataReaderException {
    GCResource file1 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part1.txt").getPath());
    GCResource file2 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part2.txt").getPath());
    GCResource file3 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part3.txt").getPath());
    GCResource file4 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part4.txt").getPath());
    GCResource file5 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part5.txt").getPath());
    GCResource file6 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part6.txt").getPath());
    GCResource file7 = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-Part7.txt").getPath());
    GCResource expectedResult = new GcResourceFile(UnittestHelper.getResource(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_8_0Series-ManuallyMerged.txt").getPath());
    GCModel expectedModel = dataReaderFacade.loadModel(expectedResult);
    List<GCResource> resources = new ArrayList<>();
    resources.add(file4);
    resources.add(file3);
    resources.add(file6);
    resources.add(file1);
    resources.add(file7);
    resources.add(file2);
    resources.add(file5);
    GcResourceSeries series = new GcResourceSeries(resources);
    GCModel result = dataReaderFacade.loadModel(series);
    assertThat(result.toString(), is(expectedModel.toString()));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Aggregations

GCResource (com.tagtraum.perf.gcviewer.model.GCResource)65 GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)55 Test (org.junit.Test)54 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)40 ByteArrayInputStream (java.io.ByteArrayInputStream)15 GCEvent (com.tagtraum.perf.gcviewer.model.GCEvent)13 GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)10 InputStream (java.io.InputStream)9 ArrayList (java.util.ArrayList)8 File (java.io.File)4 GCModelLoader (com.tagtraum.perf.gcviewer.ctrl.GCModelLoader)2 LogRecord (java.util.logging.LogRecord)2 GCModelLoaderGroupTracker (com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderGroupTracker)1 Before (org.junit.Before)1 Ignore (org.junit.Ignore)1