gctoolkit
gctoolkit copied to clipboard
Fix for Legacy ZGC log files without details (-Xlog:gc)
trafficstars
Small log sample attached from Java 21 without +ZGenerational and using -Xlog:gc rather than -Xlog:gc* (detailed)
ZGCParser was unable to parse the events from this log as there is only one line logged per event, and thus, no "cycle start" that would generate the forwardReference. This is not an issue for Generational, as two lines are logged for each event, so the special case only applies to Full/Garbage type ZGC events.
Fixed this issue and added test cases for both Generational and non-generational lines without details to ZGCParserTest.
Also took the opportunity to update deprecated .getTimeStamp() calls to .toSeconds() in ZGCParserTest.