gctoolkit
gctoolkit copied to clipboard
GC Phase Times getter for the Parallel GC
Parsing seems to be done but getter is missing from GenerationalForwardReference.
The forward references are sort of like builder patterns and are turned into events. For example, here's some code from G1CGForwardReference:
private G1Young buildYoung(G1Young collection) {
fillInMemoryPoolStats(collection);
fillInRegionSummary(collection);
fillInMetaspaceStats(collection);
fillInPhases(collection);
if (toSpaceExhausted) collection.toSpaceExhausted();
if (hasReferenceGCSummary())
collection.add(generateReferenceGCSummary());
collection.addCPUSummary(getCPUSummary());
return collection;
}
There are similar methods for other event types.
The reason we've done this is that events are immutable. To create the immutable event, we collect the data before building the event. This is the purpose of the forward reference. Once the end of the event is parsed, we build the event. This is why there are no getters on the forward references.
If one wants to include more data in the event, no problem. One just need to make sure the data is collected and pushed to the forward reference and then added to the event. Note that events are part of the public API so adding new API is okay but existing methods should not be modified.
This comment applies to the other issues filed regarding missing getters.