Skip to content

Commit

Permalink
Add Evacuation workers getter for G1 GC (#366)
Browse files Browse the repository at this point in the history
Co-authored-by: Alina Hovakimyan <alinahovakimyan@Alinas-MacBook-Pro.local>
  • Loading branch information
AlinaHovakimyan and Alina Hovakimyan committed Jul 2, 2024
1 parent 81b2744 commit ff53a38
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/src/main/java/com/microsoft/gctoolkit/event/g1gc/G1Young.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class G1Young extends G1RealPause {

private double parallelPhaseDuration = -1.0d;
private int gcWorkers;
private int evacuationWorkersUsed;
private int evacuationWorkersAvailable;
private double codeRootFixupDuration = -1.0d;
private double codeRootMigrationDuration = -1.0d;
private double codeRootPurgeDuration = -1.0d;
Expand Down Expand Up @@ -62,6 +64,14 @@ public void setGcWorkers(int count) {
this.gcWorkers = count;
}

public void setEvacuationWorkersUsed(int evacuationWorkersUsed) {
this.evacuationWorkersUsed = evacuationWorkersUsed;
}

public void setEvacuationWorkersAvailable(int evacuationWorkersAvailable) {
this.evacuationWorkersAvailable = evacuationWorkersAvailable;
}

public void setCodeRootFixupDuration(double duration) {
this.codeRootFixupDuration = duration;
}
Expand Down Expand Up @@ -107,6 +117,14 @@ public int getGcWorkers() {
return gcWorkers;
}

public int getEvacuationWorkersUsed() {
return evacuationWorkersUsed;
}

public int getEvacuationWorkersAvailable() {
return evacuationWorkersAvailable;
}

public double getCodeRootFixupDuration() {
return codeRootFixupDuration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ private void fillInPhases(G1Young collection) {
postEvacuateCSetPhaseNames().forEach(name -> collection.addPostEvacuationCollectionPhase(name, postEvacuateCSetPhaseDuration(name)));
}

private void fillInWorkers(G1Young collection) {
collection.setEvacuationWorkersUsed(evacuationWorkersUsed);
collection.setEvacuationWorkersAvailable(evacuationWorkersAvailable);
}

private DateTimeStamp pausePhaseDuringConcurrentCycleTime = null;
private double pausePhaseDuringConcurrentCycleDuration = -1.0d;

Expand Down Expand Up @@ -772,6 +777,7 @@ private G1Young buildYoung(G1Young collection) {
fillInRegionSummary(collection);
fillInMetaspaceStats(collection);
fillInPhases(collection);
fillInWorkers(collection);
if (toSpaceExhausted) collection.toSpaceExhausted();
if (hasReferenceGCSummary())
collection.add(generateReferenceGCSummary());
Expand Down

0 comments on commit ff53a38

Please sign in to comment.