Skip to content

Commit

Permalink
refactor: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
kcpeppe committed Apr 20, 2022
1 parent 4c0c81a commit 99f423c
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 195 deletions.
156 changes: 78 additions & 78 deletions api/src/main/java/com/microsoft/gctoolkit/event/GCEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,83 +86,83 @@ public GarbageCollectionTypes getGarbageCollectionType() {
return gcType;
}

/**
*
* @return is a Z cycle
*/
public boolean isZGC() { return false; }

/**
*
* @return is a young collection
*/
public boolean isYoung() {
return false;
}

/**
*
* @return is a full collection
*/
public boolean isFull() {
return false;
}

/**
*
* @return is a concurrent phase
*/
public boolean isConcurrent() {
return false;
}

/**
*
* @return is a G1 young collection
*/
public boolean isG1Young() {
return false;
}

/**
*
* @return is a G1 mixed collection
*/
public boolean isG1Mixed() {
return false;
}

/**
*
* @return is a G1 concurrent phase
*/
public boolean isG1Concurrent() {
return false;
}

/**
*
* @return triggered by System.gc() or Runtime.gc().
*/
public boolean isSystemGC() {
return false;
}

/**
*
* @return the type is a CMF
*/
public boolean isConcurrentModeFailure() {
return false;
}

/**
*
* @return the type is a CMI
*/
public boolean isConcurrentModeInterrupted() {
return false;
}
// /**
// *
// * @return is a Z cycle
// */
// public boolean isZGC() { return false; }
//
// /**
// *
// * @return is a young collection
// */
// public boolean isYoung() {
// return false;
// }
//
// /**
// *
// * @return is a full collection
// */
// public boolean isFull() {
// return false;
// }
//
// /**
// *
// * @return is a concurrent phase
// */
// public boolean isConcurrent() {
// return false;
// }
//
// /**
// *
// * @return is a G1 young collection
// */
// public boolean isG1Young() {
// return false;
// }
//
// /**
// *
// * @return is a G1 mixed collection
// */
// public boolean isG1Mixed() {
// return false;
// }
//
// /**
// *
// * @return is a G1 concurrent phase
// */
// public boolean isG1Concurrent() {
// return false;
// }
//
// /**
// *
// * @return triggered by System.gc() or Runtime.gc().
// */
// public boolean isSystemGC() {
// return false;
// }
//
// /**
// *
// * @return the type is a CMF
// */
// public boolean isConcurrentModeFailure() {
// return false;
// }
//
// /**
// *
// * @return the type is a CMI
// */
// public boolean isConcurrentModeInterrupted() {
// return false;
// }

/**
*
Expand All @@ -171,7 +171,7 @@ public boolean isConcurrentModeInterrupted() {
* @param y is a value
* @return boolean is diff is greater than threshold
*/
private static boolean withinThreshold(final double x, final double y) {
private boolean withinThreshold(final double x, final double y) {
return TIMESTAMP_THRESHOLD > Math.abs(x - y);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ public G1FullGC(DateTimeStamp timeStamp, GarbageCollectionTypes type, GCCause ca
super(timeStamp, type, cause, pauseTime);
}

public boolean isFull() {
return true;
}

public void addInternalPhase(String internalPhase, Double duration) {
internalPhaseTimes.put(internalPhase, duration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ public double getUnloadingTime() {
return this.unloadingTime;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,4 @@ public class G1SystemGC extends G1FullGC {
public G1SystemGC(DateTimeStamp timeStamp, double pauseTime) {
super(timeStamp, GarbageCollectionTypes.SystemGC, GCCause.JAVA_LANG_SYSTEM, pauseTime);
}

public boolean isFull() {
return true;
}

public boolean isSystemGC() {
return true;
}


}
42 changes: 0 additions & 42 deletions api/src/main/java/com/microsoft/gctoolkit/event/g1gc/G1Trap.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,48 +69,6 @@ public GarbageCollectionTypes getGarbageCollectionType() {
return super.getGarbageCollectionType();
}

@Override
public boolean isYoung() {
trap(new Exception());
return super.isYoung();
}

@Override
public boolean isFull() {
trap(new Exception());
return super.isFull();
}

@Override
public boolean isConcurrent() {
trap(new Exception());
return super.isConcurrent();
}

@Override
public boolean isG1Young() {
trap(new Exception());
return super.isG1Young();
}

@Override
public boolean isG1Mixed() {
trap(new Exception());
return super.isG1Mixed();
}

@Override
public boolean isG1Concurrent() {
trap(new Exception());
return super.isG1Concurrent();
}

@Override
public boolean isSystemGC() {
trap(new Exception());
return super.isSystemGC();
}

@Override
public void addMemorySummary(MemoryPoolSummary eden, SurvivorMemoryPoolSummary survivor, MemoryPoolSummary heap) {
trap(new Exception());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,5 @@ public Stream<String> postEvacuateCSetPhaseNames() {
public double postEvacuateCSetPhaseDuration(String name) {
return postEvacuateCSetPhase.get(name);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,4 @@ public double getWallClockTime() {
return wallClockTime;
}

@Override
public boolean isConcurrent() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@ public class ConcurrentModeFailure extends FullGC {
public ConcurrentModeFailure(DateTimeStamp timeStamp, GCCause cause, double duration) {
super(timeStamp, GarbageCollectionTypes.ConcurrentModeFailure, cause, duration);
}

@Override
public boolean isConcurrentModeFailure() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ public ConcurrentModeInterrupted(DateTimeStamp timeStamp, GarbageCollectionTypes
public ConcurrentModeInterrupted(DateTimeStamp timeStamp, GCCause cause, double duration) {
this(timeStamp, GarbageCollectionTypes.ConcurrentModeInterrupted, cause, duration);
}

@Override
public boolean isConcurrentModeInterrupted() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,4 @@ public class DefNew extends GenerationalGCPauseEvent {
public DefNew(DateTimeStamp timeStamp, GCCause cause, double duration) {
super(timeStamp, GarbageCollectionTypes.DefNew, cause, duration);
}

@Override
public boolean isYoung() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,4 @@ public int getDutyCycle() {
return dutyCycle;
}

@Override
public boolean isFull() {
return true;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ public PSYoungGen(DateTimeStamp timeStamp, GarbageCollectionTypes type, GCCause
public PSYoungGen(DateTimeStamp timeStamp, GCCause cause, double duration) {
super(timeStamp, GarbageCollectionTypes.PSYoungGen, cause, duration);
}

@Override
public boolean isYoung() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,4 @@ public TLABSummary getTlabSummary() {
return tlabSummary;
}

@Override
public boolean isYoung() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ public ParNewPromotionFailed(DateTimeStamp dateTimeStamp, GCCause gcCause, doubl
public ParNewPromotionFailed(DateTimeStamp dateTimeStamp, double pauseTime) {
this(dateTimeStamp, GCCause.PROMOTION_FAILED, pauseTime);
}

@Override
public boolean isYoung() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ public SystemGC(DateTimeStamp timeStamp, GCCause cause, double duration) {
public SystemGC(DateTimeStamp timeStamp, double duration) {
this(timeStamp, GarbageCollectionTypes.SystemGC, GCCause.JAVA_LANG_SYSTEM, duration);
}

@Override
public boolean isSystemGC() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ public YoungGC(DateTimeStamp timeStamp, GarbageCollectionTypes gcType, GCCause c
public YoungGC(DateTimeStamp timeStamp, GCCause cause, double duration) {
this(timeStamp, GarbageCollectionTypes.GC, cause, duration);
}

@Override
public boolean isYoung() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ public ZGCCycle(DateTimeStamp timeStamp, GarbageCollectionTypes gcType, double d
super(timeStamp, gcType, duration);
}

@Override
public boolean isZGC() { return true; }

private DateTimeStamp pauseMarkStartTimeStamp;
private double pauseMarkStartDuration;

Expand Down

0 comments on commit 99f423c

Please sign in to comment.