use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderIBM1_2_2 method testParse1.
@Test
public void testParse1() throws Exception {
String fileName = "SampleIBM1_2_2.txt";
InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_IBM, fileName);
DataReader reader = new DataReaderIBM1_3_0(new GcResourceFile(fileName), in);
GCModel model = reader.read();
assertEquals("number of events", 28, model.size());
}
use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderIBM_J9_R27 method testFullHeaderWithAfGcs.
@Test
public void testFullHeaderWithAfGcs() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleIBMJ9_R27_SR1_full_header.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertThat("model size", model.size(), is(3));
GCEvent event = (GCEvent) model.get(0);
assertThat("pause", event.getPause(), closeTo(0.042303, 0.0000001));
assertThat("total before", event.getTotal(), is(toKiloBytes(1073741824)));
assertThat("free before", event.getPreUsed(), is(toKiloBytes(1073741824 - 804158480)));
assertThat("free after", event.getPostUsed(), is(toKiloBytes(1073741824 - 912835672)));
assertThat("total young before", event.getYoung().getTotal(), is(toKiloBytes(268435456)));
assertThat("young before", event.getYoung().getPreUsed(), is(toKiloBytes(268435456)));
assertThat("young after", event.getYoung().getPostUsed(), is(toKiloBytes(268435456 - 108677192)));
assertThat("total tenured before", event.getTenured().getTotal(), is(toKiloBytes(805306368)));
assertThat("tenured before", event.getTenured().getPreUsed(), is(toKiloBytes(805306368 - 804158480)));
assertThat("tenured after", event.getTenured().getPostUsed(), is(toKiloBytes(805306368 - 804158480)));
assertThat("timestamp 1", event.getTimestamp(), closeTo(0.0, 0.0001));
assertThat("timestamp 2", model.get(1).getTimestamp(), closeTo(1.927, 0.0001));
assertThat("timestamp 3", model.get(2).getTimestamp(), closeTo(3.982, 0.0001));
assertThat("number of errors", handler.getCount(), is(1));
}
use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class AbstractGCModelLoaderImpl method doInBackground.
@Override
protected GCModel doInBackground() throws Exception {
setProgress(0);
final GCModel result;
try {
result = loadGcModel();
} catch (DataReaderException | RuntimeException e) {
Logger logger = getGcResource().getLogger();
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "Failed to load GCModel from " + getGcResource().getResourceName(), e);
}
throw e;
}
return result;
}
use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderHPUX1_2 method testParse1.
@Test
public void testParse1() throws Exception {
String fileName = "SampleHP-UX1_3.txt";
InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_HP, fileName);
DataReader reader = new DataReaderHPUX1_2(new GcResourceFile(fileName), in);
GCModel model = reader.read();
assertEquals("number of events", 135, model.size());
}
use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.
the class TestDataReaderHPUX1_4_1 method testParse1.
@Test
public void testParse1() throws Exception {
String fileName = "SampleHP-UX1_4_1.txt";
final InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_HP, fileName);
final DataReader reader = new DataReaderHPUX1_4_1(new GcResourceFile(fileName), in);
GCModel model = reader.read();
assertEquals("number of events", 4, model.size());
}
Aggregations