Search in sources :

Example 41 with GCResource

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

the class GcSeriesLoader method determineStartTimePerGcModel.

private Map<Timestamp, GCModel> determineStartTimePerGcModel(GcResourceSeries series) throws DataReaderException {
    Map<Timestamp, GCModel> startTimeToGcModel = new HashMap<>();
    for (GCResource resource : series.getResourcesInOrder()) {
        Optional<GCModel> model = loadGcModel(resource);
        if (model.isPresent()) {
            Timestamp timeStamp = getCreationDate(model.get());
            startTimeToGcModel.put(timeStamp, model.get());
        } else {
            logger.log(Level.WARNING, "Failed to load " + resource + " - ignoring it");
        }
    }
    return startTimeToGcModel;
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GCModel(com.tagtraum.perf.gcviewer.model.GCModel)

Example 42 with GCResource

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

the class GCModelLoaderControllerImpl method add.

@Override
public void add(File[] files) {
    List<GCResource> gcResourceList = new ArrayList<>();
    for (File file : files) {
        GCResource gcResource = new GcResourceFile(file.getAbsolutePath());
        gcResourceList.add(gcResource);
        addGCResource(gcResource);
    }
    getRecentGCResourcesModel().add(gcResourceList);
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) File(java.io.File) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile)

Example 43 with GCResource

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

the class GCModelLoaderControllerImpl method add.

@Override
public void add(List<GCResource> gcResourceList) {
    for (GCResource gcResource : gcResourceList) {
        gcResource.reset();
        addGCResource(gcResource);
    }
    getRecentGCResourcesModel().add(gcResourceList);
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource)

Example 44 with GCResource

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

the class GCModelLoaderControllerImpl method reload.

@Override
public GCModelLoaderGroupTracker reload(GCDocument gcDocument) {
    GCModelLoaderGroupTracker tracker = new GCModelLoaderGroupTrackerImpl();
    for (GCResource gcResource : gcDocument.getGCResources()) {
        if (gcResource.hasUnderlyingResourceChanged()) {
            gcResource.reset();
            gcResource.setIsReload(true);
            GCModelLoader loader = GCModelLoaderFactory.createFor(gcResource);
            GCDocumentController docController = getDocumentController(gcDocument);
            docController.reloadGCResource(loader);
            tracker.addGcModelLoader(loader);
        }
    }
    tracker.execute();
    return tracker;
}
Also used : GCModelLoader(com.tagtraum.perf.gcviewer.ctrl.GCModelLoader) GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GCModelLoaderGroupTracker(com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderGroupTracker)

Example 45 with GCResource

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

the class GCModelLoaderControllerImpl method open.

@Override
public void open(File[] files) {
    List<GCResource> gcResourceList = new ArrayList<GCResource>();
    for (File file : files) {
        GCResource gcResource = new GcResourceFile(file.getAbsolutePath());
        gcResourceList.add(gcResource);
    }
    open(gcResourceList);
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) File(java.io.File) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile)

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