Search in sources :

Example 1 with DataReaderFacade

use of com.tagtraum.perf.gcviewer.imp.DataReaderFacade in project GCViewer by chewiebug.

the class TestGCModel method testGetStartDate_WhenDateStampsAreAvailable.

@Test
public void testGetStartDate_WhenDateStampsAreAvailable() throws Exception {
    DataReaderFacade dataReader = new DataReaderFacade();
    GCModel model = dataReader.loadModel(new GcResourceFile(UnittestHelper.getResourceAsString(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_6_0CMSAdaptiveSizePolicy.txt")));
    ZonedDateTime expectedTime = ZonedDateTime.of(2012, 4, 18, 14, 23, 59, 890_000_000, ZoneId.ofOffset("", ZoneOffset.ofHours(2)));
    assertThat(model.getStartDate(), is(expectedTime));
}
Also used : ZonedDateTime(java.time.ZonedDateTime) DataReaderFacade(com.tagtraum.perf.gcviewer.imp.DataReaderFacade) Test(org.junit.Test)

Example 2 with DataReaderFacade

use of com.tagtraum.perf.gcviewer.imp.DataReaderFacade in project GCViewer by chewiebug.

the class TestGCModel method testEquals_ForIdenticalModels.

@Test
public void testEquals_ForIdenticalModels() throws IOException, ExecutionException, InterruptedException, DataReaderException {
    // load model twice, should be identical
    GCResource gcResource = new GcResourceFile(UnittestHelper.getResourceAsString(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_6_0CMS.txt"));
    DataReaderFacade dataReader = new DataReaderFacade();
    GCModel actual = dataReader.loadModel(gcResource);
    GCModel expected = dataReader.loadModel(gcResource);
    assertThat(actual, is(expected));
}
Also used : DataReaderFacade(com.tagtraum.perf.gcviewer.imp.DataReaderFacade) Test(org.junit.Test)

Example 3 with DataReaderFacade

use of com.tagtraum.perf.gcviewer.imp.DataReaderFacade in project GCViewer by chewiebug.

the class TestGCModel method testGetStartDate_WhenNoDateButTimestampsAreAvailable.

@Test
public void testGetStartDate_WhenNoDateButTimestampsAreAvailable() throws Exception {
    DataReaderFacade dataReader = new DataReaderFacade();
    GcResourceFile gcResource = new GcResourceFile(UnittestHelper.getResourceAsString(UnittestHelper.FOLDER_OPENJDK, "SampleSun1_6_0CMS.txt"));
    GCModel model = dataReader.loadModel(gcResource);
    ZonedDateTime expectedTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(model.getLastModified()), ZoneId.systemDefault());
    // 1,381s (diff between last and first timestamp
    expectedTime = expectedTime.minus(1381, ChronoUnit.MILLIS);
    assertThat(model.getStartDate(), is(expectedTime));
}
Also used : ZonedDateTime(java.time.ZonedDateTime) DataReaderFacade(com.tagtraum.perf.gcviewer.imp.DataReaderFacade) Test(org.junit.Test)

Example 4 with DataReaderFacade

use of com.tagtraum.perf.gcviewer.imp.DataReaderFacade in project GCViewer by chewiebug.

the class GcSeriesLoaderTest method setUp.

@Before
public void setUp() throws Exception {
    dataReader = new DataReaderFacade();
    loader = new GcSeriesLoader(dataReader);
}
Also used : DataReaderFacade(com.tagtraum.perf.gcviewer.imp.DataReaderFacade) Before(org.junit.Before)

Example 5 with DataReaderFacade

use of com.tagtraum.perf.gcviewer.imp.DataReaderFacade in project GCViewer by chewiebug.

the class GCViewer method export.

private void export(GCResource gcResource, String summaryFilePath, String chartFilePath, DataWriterType type) throws IOException, DataReaderException {
    DataReaderFacade dataReaderFacade = new DataReaderFacade();
    GCModel model = dataReaderFacade.loadModel(gcResource);
    exportType(model, summaryFilePath, type);
    if (chartFilePath != null)
        renderChart(model, chartFilePath);
}
Also used : DataReaderFacade(com.tagtraum.perf.gcviewer.imp.DataReaderFacade) GCModel(com.tagtraum.perf.gcviewer.model.GCModel)

Aggregations

DataReaderFacade (com.tagtraum.perf.gcviewer.imp.DataReaderFacade)5 Test (org.junit.Test)3 ZonedDateTime (java.time.ZonedDateTime)2 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)1 Before (org.junit.Before)1