Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generational zgc #368

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.microsoft.gctoolkit.event.g1gc.G1GCPauseEvent;
import com.microsoft.gctoolkit.event.generational.GenerationalGCPauseEvent;
import com.microsoft.gctoolkit.event.shenandoah.ShenandoahCycle;
import com.microsoft.gctoolkit.event.zgc.ZGCCycle;
import com.microsoft.gctoolkit.event.zgc.MajorZGCCycle;

@Aggregates({EventSource.G1GC,EventSource.GENERATIONAL,EventSource.ZGC,EventSource.SHENANDOAH})
public class CollectionCycleCountsAggregator extends Aggregator<CollectionCycleCountsAggregation> {
Expand All @@ -17,11 +17,11 @@ public CollectionCycleCountsAggregator(CollectionCycleCountsAggregation results)
register(GenerationalGCPauseEvent.class, this::count);
register(G1GCPauseEvent.class, this::count);
register(G1GCConcurrentEvent.class, this::count);
register(ZGCCycle.class,this::count);
register(MajorZGCCycle.class,this::count);
register(ShenandoahCycle.class,this::count);
}

private void count(ZGCCycle event) {
private void count(MajorZGCCycle event) {
aggregation().count(event.getGarbageCollectionType());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.microsoft.gctoolkit.event.g1gc.G1GCPauseEvent;
import com.microsoft.gctoolkit.event.generational.GenerationalGCPauseEvent;
import com.microsoft.gctoolkit.event.shenandoah.ShenandoahCycle;
import com.microsoft.gctoolkit.event.zgc.ZGCCycle;
import com.microsoft.gctoolkit.event.zgc.MajorZGCCycle;

@Aggregates({EventSource.G1GC,EventSource.GENERATIONAL,EventSource.ZGC,EventSource.SHENANDOAH})
public class HeapOccupancyAfterCollectionAggregator extends Aggregator<HeapOccupancyAfterCollectionAggregation> {
Expand All @@ -15,7 +15,7 @@ public HeapOccupancyAfterCollectionAggregator(HeapOccupancyAfterCollectionAggreg
super(results);
register(GenerationalGCPauseEvent.class, this::extractHeapOccupancy);
register(G1GCPauseEvent.class, this::extractHeapOccupancy);
register(ZGCCycle.class,this::extractHeapOccupancy);
register(MajorZGCCycle.class,this::extractHeapOccupancy);
register(ShenandoahCycle.class,this::extractHeapOccupancy);
}

Expand All @@ -29,7 +29,7 @@ private void extractHeapOccupancy(G1GCPauseEvent event) {
aggregation().addDataPoint(event.getGarbageCollectionType(), event.getDateTimeStamp(), event.getHeap().getOccupancyAfterCollection());
}

private void extractHeapOccupancy(ZGCCycle event) {
private void extractHeapOccupancy(MajorZGCCycle event) {
aggregation().addDataPoint(event.getGarbageCollectionType(), event.getDateTimeStamp(), event.getLive().getReclaimEnd());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package com.microsoft.gctoolkit.event.zgc;

import com.microsoft.gctoolkit.event.GCCause;
import com.microsoft.gctoolkit.event.GarbageCollectionTypes;
import com.microsoft.gctoolkit.time.DateTimeStamp;

public class MajorZGCCycle extends ZGCCycle {
public MajorZGCCycle(DateTimeStamp timeStamp, GarbageCollectionTypes gcType, GCCause cause, double duration) {
super(timeStamp, gcType, cause, duration);
}

public MajorZGCCycle(DateTimeStamp timeStamp, double duration) {
super(timeStamp, duration);
}

public MajorZGCCycle(DateTimeStamp timeStamp, GCCause cause, double duration) {
super(timeStamp, cause, duration);
}

public MajorZGCCycle(DateTimeStamp timeStamp, GarbageCollectionTypes gcType, double duration) {
super(timeStamp, gcType, duration);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package com.microsoft.gctoolkit.event.zgc;

import com.microsoft.gctoolkit.event.GCCause;
import com.microsoft.gctoolkit.event.GarbageCollectionTypes;
import com.microsoft.gctoolkit.time.DateTimeStamp;

public class MinorZGCCycle extends MajorZGCCycle {
public MinorZGCCycle(DateTimeStamp timeStamp, GarbageCollectionTypes gcType, GCCause cause, double duration) {
super(timeStamp, gcType, cause, duration);
}

public MinorZGCCycle(DateTimeStamp timeStamp, double duration) {
super(timeStamp, duration);
}

public MinorZGCCycle(DateTimeStamp timeStamp, GCCause cause, double duration) {
super(timeStamp, cause, duration);
}

public MinorZGCCycle(DateTimeStamp timeStamp, GarbageCollectionTypes gcType, double duration) {
super(timeStamp, gcType, duration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ public long getReclaimStart() {
public long getReclaimEnd() {
return reclaimEnd;
}

public OccupancySummary sum(OccupancySummary other) {
if (other == null) {
return this;
}
return new OccupancySummary(markEnd + other.markEnd, reclaimStart + other.reclaimStart, reclaimEnd + other.reclaimEnd);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ public long getReclaimEnd() {
return reclaimEnd;
}

public ReclaimSummary sum(ReclaimSummary other) {
if (other == null) {
return this;
}
return new ReclaimSummary(reclaimStart + other.reclaimStart, reclaimEnd + other.reclaimEnd);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public interface GenericTokens {
String INTEGER = "\\d+";
String REAL_NUMBER = INTEGER + DECIMAL_POINT + INTEGER;
String PERCENTAGE = "(" + REAL_NUMBER + ")" + "\\s?%";
String INT_PERCENTAGE = "(" + INTEGER + ")" + "%";
String HEX = "0x[0-9,a-f]{16}";
String INT = "(" + INTEGER + ")";
String COUNTER = INT;
Expand All @@ -19,6 +20,7 @@ public interface GenericTokens {
//Time
String TIME = "(-?" + REAL_NUMBER + ")";
String DURATION_MS = TIME + "\\s?ms";
String INT_DURATION_MS = INTEGER + "ms";
//0.0700188
String PAUSE_TIME = TIME + "\\s?(?:secs?|ms)";
String CONCURRENT_TIME = PAUSE_TIME;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package com.microsoft.gctoolkit.parser;

public enum ZGCMemoryScope {
ALL,
YOUNG_GENERATION,
OLD_GENERATION;
}
Loading