Fix for Legacy ZGC log files without details (-Xlog:gc)
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.
@kcpeppe - I'm thinking we want to handle this is a consistent way across all collectors. We had the notion of using the diarizer to know whether the log didn't have enough detail. We discussed this in the (somewhat stale) PR #409
I was debating taking a stab at #336 and implementing something like that where the diary would contain information about the Java Flags used from the command line if present (pre-unified) or what we can infer from unified logs during the diarizing process. I was thinking of adding a key/value map for storing this information rather than exclusively using flags as is currently done.
Unfortunately, my priorities are going to be shifting for a bit, so I'm not certain if I can get to it in the near term. But if you have some thoughts, I'm all ears.
@jlittle-ptc apologies for not pushing on this earlier. We did merge another major refactor of the ZGC parser etc, so I'm afraid this will need a rebase.
Hopefully I'll have some time this week to review the changes. There's a possibility that I might withdraw this PR and create a new one.
Updated and posted a new PR #448. Closing this one.