-
- All Known Implementing Classes:
AbstractJavaVirtualMachine,PreUnifiedJavaVirtualMachine,UnifiedJavaVirtualMachine
public interface JavaVirtualMachineJavaVirtualMachine is a representation of the JVM state obtained by analyzing a GC log file. An instance of JavaVirtualMachine is created by callingGCToolKit.analyze(DataSource)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccepts(DataSource dataSource)voidanalyze(List<Aggregator<? extends Aggregation>> registeredAggregations, JVMEventChannel eventChannel, DataSourceChannel dataSourceChannel)Interface to trigger the analysis of a gc log.<T extends Aggregation>
Optional<T>getAggregation(Class<T> aggregationClass)Return theAggregationthat was used in the analysis of the GC log file that is the same class asaggregationClass.StringgetCommandLine()Return the command line used to run the JVM, if available.DateTimeStampgetEstimatedJVMStartTime()Estimates the initial start time of the log in the case that the log is determined to be a fragment.DateTimeStampgetJVMTerminationTime()Return the time of the last event in the GC log file.doublegetRuntimeDuration()Return the runtime duration.DateTimeStampgetTimeOfFirstEvent()Return the time of the first event in the GC log file.booleanisCMS()Returntrueif the JVM was using CMS GC.booleanisG1GC()Returntrueif the JVM was using G1GC.booleanisParallel()Returntrueif the JVM was using Parallel GC.booleanisSerial()Returntrueif the JVM was using Serial GC.booleanisShenandoah()Returntrueif the JVM was using Shenandoah.booleanisUnifiedLogging()True if the log is unified or false for preunifiedbooleanisZGC()Returntrueif the JVM was using ZGC.
-
-
-
Method Detail
-
accepts
boolean accepts(DataSource dataSource)
- Parameters:
dataSource- the log to be considered. Returntrueif the JavaVirtualMachine implementation can work with the GC log.- Returns:
trueif the JavaVirtualMachine implementation can work with the GC Log.
-
isUnifiedLogging
boolean isUnifiedLogging()
True if the log is unified or false for preunified- Returns:
- true is the log is from JDK 9+
-
isG1GC
boolean isG1GC()
Returntrueif the JVM was using G1GC.- Returns:
trueif the GC is G1GC.
-
isZGC
boolean isZGC()
Returntrueif the JVM was using ZGC.- Returns:
trueif the GC is ZGC.
-
isShenandoah
boolean isShenandoah()
Returntrueif the JVM was using Shenandoah.- Returns:
trueif the GC is Shenandoah.
-
isParallel
boolean isParallel()
Returntrueif the JVM was using Parallel GC.- Returns:
trueif the GC is Parallel GC.
-
isSerial
boolean isSerial()
Returntrueif the JVM was using Serial GC.- Returns:
trueif the GC is Serial GC.
-
isCMS
boolean isCMS()
Returntrueif the JVM was using CMS GC.- Returns:
trueif the GC is CMS GC.
-
getCommandLine
String getCommandLine()
Return the command line used to run the JVM, if available.- Returns:
- The command line used to run the JVM, or
null
-
getTimeOfFirstEvent
DateTimeStamp getTimeOfFirstEvent()
Return the time of the first event in the GC log file.- Returns:
- The time of the last event.
-
getEstimatedJVMStartTime
DateTimeStamp getEstimatedJVMStartTime()
Estimates the initial start time of the log in the case that the log is determined to be a fragment. Otherwise, return a start time of 0.000 seconds- Returns:
- The time of the first event.
-
getJVMTerminationTime
DateTimeStamp getJVMTerminationTime()
Return the time of the last event in the GC log file.- Returns:
- The time of the last event.
-
getRuntimeDuration
double getRuntimeDuration()
Return the runtime duration. This is not necessarily the difference between the first and last event. Rather, this calculation considers the duration of the events.- Returns:
- The runtime duration that the GC log represents.
-
getAggregation
<T extends Aggregation> Optional<T> getAggregation(Class<T> aggregationClass)
Return theAggregationthat was used in the analysis of the GC log file that is the same class asaggregationClass. In other words,aggregationClassis a key used to look up an instance of theAggregation. The return value may benullif theAggregationwas not used in the analysis. WhichAggregations are used depends on the GC.- Type Parameters:
T- type cast for the Aggregation class type.- Parameters:
aggregationClass- The class of the Aggregation to be returned.- Returns:
- an
AggregationwhosegetClass() == aggregationClass, ornullif given aggregationClass is not available.
-
analyze
void analyze(List<Aggregator<? extends Aggregation>> registeredAggregations, JVMEventChannel eventChannel, DataSourceChannel dataSourceChannel)
Interface to trigger the analysis of a gc log.- Parameters:
registeredAggregations- all aggregations supplied by the module SPIeventChannel- JVMEvent message channeldataSourceChannel- GC logging data channel
-
-