Interface DiagnosticsMBean

All Known Implementing Classes:
Diagnostics

public interface DiagnosticsMBean
Interface for the diagnostics MBean.
Author:
Laurent Cohen
  • Field Details

  • Method Details

    • memoryInformation

      MemoryInformation memoryInformation() throws Exception
      Get the current state of the heap and non-heap memory for the JVM.
      Returns:
      a MemoryInformation instance.
      Throws:
      Exception - if any error occurs.
    • threadNames

      String[] threadNames() throws Exception
      Get the names of all live threads in the current JVM.
      Returns:
      an arrray of thread names as strings.
      Throws:
      Exception - if any error occurs.
    • gc

      void gc() throws Exception
      Perform a full garbage collection. This method calls System.gc().
      Throws:
      Exception - if any error occurs.
    • threadDump

      ThreadDump threadDump() throws Exception
      Get a full thread dump, including detection of deadlocks.
      Returns:
      a ThreadDump instance.
      Throws:
      Exception - if any error occurs.
    • hasDeadlock

      Boolean hasDeadlock() throws Exception
      Determine whether a deadlock is detected in the JVM.
      Returns:
      true if a deadlock is detected, false otherwise.
      Throws:
      Exception - if any error occurs.
    • healthSnapshot

      HealthSnapshot healthSnapshot() throws Exception
      Get a summarized snapshot of the JVM health.
      Returns:
      a HealthSnapshot instance.
      Throws:
      Exception - if any error occurs.
    • healthSnapshotAsString

      String healthSnapshotAsString() throws Exception
      Get a a string representation of a JVM health snapshot. The returned string contains a set of key / value pairs separated by new lines. As such, it can be loaded directly into a Properties or TypedProperties object via their load(Reader) method, using a StringReader.
      Returns:
      a Properties-compatible string representation of a JVM health snapshot.
      Throws:
      Exception - if any error occurs.
    • heapDump

      String heapDump() throws Exception
      Trigger a heap dump of the JVM. This will not work with all JVM implementations. It should work with Oracle standard and JRockit JVMs, along with IBM JVM.
      Returns:
      a message describing the outcome.
      Throws:
      Exception - if any error occurs.
    • cpuLoad

      Double cpuLoad()
      Get an approximation of the current CPU load. The computed value is equal to sumi(thread_used_cpui) / interval, for all the live threads of the JVM at the time of the computation. Thus, errors may occur, since many threads may have been created then died between two computations. However, in most cases this is a reasonable approximation, whose computation does not tax the CPU too heavily.
      Returns:
      the cpu load as a double value in the range [0, 1] (ratio of totalCpuTime / computationInterval), or -1d if CPU time measurement is not available for the JVM.
    • getMonitoringDataProperties

      List<JPPFProperty<?>> getMonitoringDataProperties()
      Get the list of properties available as monitoring data.
      Returns:
      a list of the properties described as instances of JPPFProperty.