Class HotThreads

java.lang.Object
org.elasticsearch.monitor.jvm.HotThreads

public class HotThreads extends Object
  • Constructor Details

    • HotThreads

      public HotThreads()
  • Method Details

    • logLocalHotThreads

      public static void logLocalHotThreads(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level, String prefix, ReferenceDocs referenceDocs)
      Capture and log the hot threads on the local node. Useful for capturing stack traces for unexpectedly-slow operations in production. The resulting log message may be large, and contains significant whitespace, so it is compressed and base64-encoded using ChunkedLoggingStream.
      Parameters:
      logger - The logger to use for the logging
      level - The log level to use for the logging.
      prefix - The prefix to emit on each chunk of the logging.
      referenceDocs - A link to the docs describing how to decode the logging.
    • logLocalCurrentThreads

      public static void logLocalCurrentThreads(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level, String prefix)
      Capture and log the current threads on the local node. Unlike hot threads this does not sample and captures current state only. Useful for capturing stack traces for unexpectedly-slow operations in production. The resulting message might be large, so it is split per thread and logged as multiple entries.
      Parameters:
      logger - The logger to use for the logging
      level - The log level to use for the logging.
      prefix - The prefix to emit on each chunk of the logging.
    • interval

      public HotThreads interval(TimeValue interval)
    • busiestThreads

      public HotThreads busiestThreads(int busiestThreads)
    • ignoreIdleThreads

      public HotThreads ignoreIdleThreads(boolean ignoreIdleThreads)
    • threadElementsSnapshotCount

      public HotThreads threadElementsSnapshotCount(int threadElementsSnapshotCount)
    • type

      public HotThreads type(HotThreads.ReportType type)
    • sortOrder

      public HotThreads sortOrder(HotThreads.SortOrder order)
    • detect

      public void detect(Writer writer) throws Exception
      Throws:
      Exception
    • detect

      public void detect(Writer writer, Runnable onNextThread) throws Exception
      Throws:
      Exception
    • initializeRuntimeMonitoring

      public static void initializeRuntimeMonitoring()