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));
}
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));
}
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));
}
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);
}
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);
}
Aggregations