Class AbstractJavaVirtualMachine

    • Constructor Detail

      • AbstractJavaVirtualMachine

        public AbstractJavaVirtualMachine()
    • Method Detail

      • setDataSource

        public void setDataSource​(DataSource logFile)
                           throws IOException
        Sets the data source
        Parameters:
        logFile - is the source of GC logging data
        Throws:
        IOException - if there is any issues reading from the data source.
      • isG1GC

        public boolean isG1GC()
        Description copied from interface: JavaVirtualMachine
        Return true if the JVM was using G1GC.
        Specified by:
        isG1GC in interface JavaVirtualMachine
        Returns:
        true if the GC is G1GC.
      • isZGC

        public boolean isZGC()
        Description copied from interface: JavaVirtualMachine
        Return true if the JVM was using ZGC.
        Specified by:
        isZGC in interface JavaVirtualMachine
        Returns:
        true if the GC is ZGC.
      • isShenandoah

        public boolean isShenandoah()
        Description copied from interface: JavaVirtualMachine
        Return true if the JVM was using Shenandoah.
        Specified by:
        isShenandoah in interface JavaVirtualMachine
        Returns:
        true if the GC is Shenandoah.
      • isParallel

        public boolean isParallel()
        Description copied from interface: JavaVirtualMachine
        Return true if the JVM was using Parallel GC.
        Specified by:
        isParallel in interface JavaVirtualMachine
        Returns:
        true if the GC is Parallel GC.
      • isSerial

        public boolean isSerial()
        Description copied from interface: JavaVirtualMachine
        Return true if the JVM was using Serial GC.
        Specified by:
        isSerial in interface JavaVirtualMachine
        Returns:
        true if the GC is Serial GC.
      • isCMS

        public boolean isCMS()
        Description copied from interface: JavaVirtualMachine
        Return true if the JVM was using CMS GC.
        Specified by:
        isCMS in interface JavaVirtualMachine
        Returns:
        true if the GC is CMS GC.
      • getCommandLine

        public String getCommandLine()
        Description copied from interface: JavaVirtualMachine
        Return the command line used to run the JVM, if available.
        Specified by:
        getCommandLine in interface JavaVirtualMachine
        Returns:
        The command line used to run the JVM, or null
      • getEstimatedJVMStartTime

        public DateTimeStamp getEstimatedJVMStartTime()
        If the first event is significantly distant from zero in relation to the time intervals between the of the next N events, where N maybe 1, then this is likely a log fragment and not the start of the run.

        Try to estimate the time at which the JVM started. For log fragments, this will be the time of the first event in the log. Otherwise it will be 0.000 seconds.

        Specified by:
        getEstimatedJVMStartTime in interface JavaVirtualMachine
        Returns:
        DateTimeStamp as estimated start time.
      • setEstimatedJVMStartTime

        public void setEstimatedJVMStartTime​(DateTimeStamp estimatedStartTime)
        Sets the estimated start time as calculated by the Aggregation class
        Parameters:
        estimatedStartTime - as calculated from observations of the event timing in the gc log.
      • getJVMTerminationTime

        public DateTimeStamp getJVMTerminationTime()
        JVM termination time will be one of either, the time stamp in the termination event if present or, the time of the last event + that events duration.
        Specified by:
        getJVMTerminationTime in interface JavaVirtualMachine
        Returns:
        DateTimeStamp
      • getRuntimeDuration

        public double getRuntimeDuration()
        Description copied from interface: JavaVirtualMachine
        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.
        Specified by:
        getRuntimeDuration in interface JavaVirtualMachine
        Returns:
        The runtime duration that the GC log represents.
      • getAggregation

        public <T extends AggregationOptional<T> getAggregation​(Class<T> aggregationClass)
        Description copied from interface: JavaVirtualMachine
        Return the Aggregation that was used in the analysis of the GC log file that is the same class as aggregationClass. In other words, aggregationClass is a key used to look up an instance of the Aggregation. The return value may be null if the Aggregation was not used in the analysis. Which Aggregations are used depends on the GC.
        Specified by:
        getAggregation in interface JavaVirtualMachine
        Type Parameters:
        T - type cast for the Aggregation class type.
        Parameters:
        aggregationClass - The class of the Aggregation to be returned.
        Returns:
        an Aggregation whose getClass() == aggregationClass, or null if given aggregationClass is not available.
      • analyze

        public void analyze​(List<Aggregator<? extends Aggregation>> registeredAggregators,
                            JVMEventChannel eventBus,
                            DataSourceChannel dataSourceBus)
        Orchestrate the analysis of a GC log. Step wise 1. find the aggregators that aggregate events generated by the gc log 2. Register the aggregators with the message bus. Setup a callback so the message framework. 3. Stream the data to a publisher 4. Wait until all the aggregators have completed 5. Set the start and end times 6. Return to the caller
        Specified by:
        analyze in interface JavaVirtualMachine
        Parameters:
        registeredAggregators - all of the aggregations loaded by the module SPI
        eventBus - the bus to publish events on
        dataSourceBus - the bus that raw log lines are published on