Skip to content

Commit

Permalink
Add test for millisecond timestamp.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Lawler authored and chewiebug committed Sep 17, 2019
1 parent a79a099 commit 85f1446
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ public void testDefaultsPauseYoungNormal() throws Exception {
assertThat("pause", model.get(0).getPause(), closeTo(0.012615, 0.00000001));
}

@Test
public void testNewUptimestamp() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("byteArray");
gcResource.getLogger().addHandler(handler);
InputStream in = new ByteArrayInputStream(
("[113ms][info][gc] GC(4) Pause Young (Normal) (G1 Evacuation Pause) 70M->70M(128M) 12.615ms")
.getBytes());

DataReader reader = new DataReaderUnifiedJvmLogging(gcResource, in);
GCModel model = reader.read();

assertThat(model.getEvents().next().getTimestamp(), is(0.113));
}

@Test
public void testDefaultsPauseYoungConcurrentStart() throws Exception {
TestLogHandler handler = new TestLogHandler();
Expand Down

0 comments on commit 85f1446

Please sign in to comment.