Search in sources :

Example 46 with GCResource

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

the class GCResourceGroup method getGCResourceList.

/**
     * Get all resources names as an array of strings.
     *
     * @return resource names as array of strings
     */
public List<GCResource> getGCResourceList() {
    List<GCResource> resources = new ArrayList<>();
    for (String entry : gcResourceList) {
        GCResource resource = getGcResource(entry);
        resources.add(resource);
    }
    return resources;
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList)

Example 47 with GCResource

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

the class RecentGCResourcesModel method getResourceNamesStartingWith.

public List<String> getResourceNamesStartingWith(String start) {
    List<String> result = new ArrayList<>();
    for (GCResource gcResource : allResources) {
        if (gcResource.getResourceName().startsWith(start)) {
            result.add(gcResource.getResourceName());
        }
    }
    Collections.sort(result);
    return result;
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) ArrayList(java.util.ArrayList)

Example 48 with GCResource

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

the class TestGCModelLoaderController method open_GcResourceSeries.

@Test
public void open_GcResourceSeries() throws Exception {
    List<GCResource> resources = getGcResourcesForSeries();
    GCResource series = new GcResourceSeries(resources);
    controller.open(series);
    assertThat(getOpenResources(), contains(series));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceSeries(com.tagtraum.perf.gcviewer.model.GcResourceSeries) Test(org.junit.Test)

Example 49 with GCResource

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

the class TestGCModelLoaderController method open_GcResourceFile.

@Test
public void open_GcResourceFile() throws Exception {
    GCResource resource = new GcResourceFile(UnittestHelper.getResourceAsString(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_6_0CMS.txt"));
    controller.open(resource);
    assertThat(getOpenResources(), contains(resource));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) Test(org.junit.Test)

Example 50 with GCResource

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

the class TestGCViewerArgsParser method onlyGcLogSeries.

@Test
public void onlyGcLogSeries() throws Exception {
    String[] args = { "some_gc.log.0;some_gc.log.1;some_gc.log.2" };
    GCViewerArgsParser gcViewerArgsParser = new GCViewerArgsParser();
    gcViewerArgsParser.parseArguments(args);
    assertEquals(gcViewerArgsParser.getArgumentCount(), 1);
    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.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)

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