Skip to content

Commit

Permalink
also accept "][safepoint" as indicator of java unified logging format
Browse files Browse the repository at this point in the history
  • Loading branch information
chewiebug committed Oct 12, 2021
1 parent 74465b6 commit 4a09773
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ else if (s.contains("<AF")) {
if (getLogger().isLoggable(Level.INFO)) getLogger().info("File format: IBM <1.3.0");
return new DataReaderIBM1_3_0(gcResource, in);
}
// ...][info][gc ] Using Shenandoah <or any other gc algorithm in unified jvm logging format>
else if (s.contains("][gc")) {
// ...][info][gc ]
// or ...][info][safepoint ] Using java unified jvm logging format
else if (s.contains("][gc") || s.contains("][safepoint")) {
if (getLogger().isLoggable(Level.INFO)) getLogger().info("File format: Oracle / OpenJDK unified jvm logging");
return new DataReaderUnifiedJvmLogging(gcResource, in);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,12 @@ public void testOracleShenandoahJ8Simple() throws Exception {
assertDataReader(DataReaderSun1_6_0.class, dr.getClass());
}

@Test
public void testOpenJdkJulRollover() throws IOException {
DataReaderFactory factory = new DataReaderFactory();
DataReader dr = factory.getDataReader(new GcResourceFile("byteArray"), new ByteArrayInputStream((
"[2019-09-17T20:20:29.824+0000][19.163s][info ][safepoint ] Total time for which application threads were stopped: 0.0047914 seconds, Stopping threads took: 0.0000103 seconds\n\n").getBytes()));
assertDataReader(DataReaderUnifiedJvmLogging.class, dr.getClass());
}

}

0 comments on commit 4a09773

Please sign in to comment.