Interface VirtualMachineStatistics

All Known Implementing Classes:
DefaultVirtualMachineStatistics

public interface VirtualMachineStatistics
Statistics on a single virtual machine level.
Author:
kimchy
  • Method Details

    • isNA

      boolean isNA()
      Returns true if this is not valid statistics.
    • getDetails

      VirtualMachineDetails getDetails()
      Returns the details of the virtual machine.
    • getTimeline

      Returns the timeline (from newest to oldest) history statistics, including this one.
    • getPrevious

      Returns the previous statistics sampled. null if this is the first one or bounded by the history size.
    • getPreviousTimestamp

      long getPreviousTimestamp()
      Returns the previous timestamp of the statistics sampled, -1 if this is the first one.
    • getTimestamp

      long getTimestamp()
      Return the timestamp when the statistics were taken.
    • getAdminTimestamp

      long getAdminTimestamp()
      Returns a timestamp that is in sync with where the admin API is running. Can return -1 if the clocks have are not sync yet.
    • getUptime

      long getUptime()
    • getMemoryHeapCommittedInBytes

      long getMemoryHeapCommittedInBytes()
    • getMemoryHeapCommittedInMB

      double getMemoryHeapCommittedInMB()
    • getMemoryHeapCommittedInGB

      double getMemoryHeapCommittedInGB()
    • getMemoryHeapUsedInBytes

      long getMemoryHeapUsedInBytes()
    • getMemoryHeapUsedInMB

      double getMemoryHeapUsedInMB()
    • getMemoryHeapUsedInGB

      double getMemoryHeapUsedInGB()
    • getMemoryHeapUsedPerc

      double getMemoryHeapUsedPerc()
      Returns the memory heap percentage from used to the max.
    • getMemoryHeapCommittedUsedPerc

      double getMemoryHeapCommittedUsedPerc()
      Returns the memory heap percentage from used to committed.
    • getMemoryNonHeapCommittedInBytes

      long getMemoryNonHeapCommittedInBytes()
    • getMemoryNonHeapCommittedInMB

      double getMemoryNonHeapCommittedInMB()
    • getMemoryNonHeapCommittedInGB

      double getMemoryNonHeapCommittedInGB()
    • getMemoryNonHeapUsedInBytes

      long getMemoryNonHeapUsedInBytes()
    • getMemoryNonHeapUsedInMB

      double getMemoryNonHeapUsedInMB()
    • getMemoryNonHeapUsedInGB

      double getMemoryNonHeapUsedInGB()
    • getMemoryNonHeapUsedPerc

      double getMemoryNonHeapUsedPerc()
      Returns the memory non heap percentage from used to the max.
    • getMemoryNonHeapCommittedUsedPerc

      double getMemoryNonHeapCommittedUsedPerc()
      Returns the memory non heap percentage from used to committed.
    • getThreadCount

      int getThreadCount()
      Returns the number of currently running threads in this virtual machine
    • getPeakThreadCount

      int getPeakThreadCount()
      Returns the maximum number of of threads that were running in the VM since it has started
    • getGcCollectionCount

      long getGcCollectionCount()
      Returns the total number of times GC was invoked for this virtual machine
    • getGcCollectionTime

      long getGcCollectionTime()
      Returns the total time in milliseconds that this virtual machine spent doing GC
    • getGcCollectionPerc

      double getGcCollectionPerc()
      The percentage of the gc collection time between the current sampled statistics and the previous one. If there is no previous one, will return -1.
    • getCpuPerc

      double getCpuPerc()
      Returns the cpu percentage this virtual machine is using.
    • getCpuPercFormatted

      String getCpuPercFormatted()
    • getCpuPercAverage

      double getCpuPercAverage(long requestedTotalTime, TimeUnit timeUnit)
      Calculates the average number of cpu cores used by the java virtual machine over the specified period of time. If not enough statistics have been accumulated, -1 is returned. In that case either call this method again after enough time has elapsed, or increase history size StatisticsMonitor.setStatisticsHistorySize(int) or increase statistics interval StatisticsMonitor.setStatisticsInterval(long, TimeUnit).
      Parameters:
      requestedTotalTime - The period of time to average the cpu percentage starting with this statistics
      timeUnit - Time units for totalTime
      Returns:
      A value between 0 and number of CPU cores representing the average number of CPU cores used, or -1 if not enough statistics have been accumulated.
      Since:
      8.0.3