Interface RecordedEventHandler

All Superinterfaces:
AutoCloseable, Consumer<RecordedEvent>, Predicate<RecordedEvent>
All Known Implementing Classes:
AbstractThreadDispatchingHandler, ClassesLoadedHandler, CodeCacheConfigurationHandler, ContainerConfigurationHandler, ContextSwitchRateHandler, DirectBufferStatisticsHandler, G1GarbageCollectionHandler, G1HeapSummaryHandler, LongLockHandler, MetaspaceSummaryHandler, NetworkReadHandler, NetworkWriteHandler, ObjectAllocationInNewTlabHandler, ObjectAllocationOutsideTlabHandler, OldGarbageCollectionHandler, OverallCpuLoadHandler, ParallelHeapSummaryHandler, ThreadCountHandler, YoungGarbageCollectionHandler

public interface RecordedEventHandler extends Consumer<RecordedEvent>, Predicate<RecordedEvent>, AutoCloseable
Convenience/Tag interface for defining how JFR events should turn into metrics.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Method Details

    • getEventName

      String getEventName()
      JFR event name (e.g. jdk.ObjectAllocationInNewTLAB)
      Returns:
      String representation of JFR event name
    • getFeature

      JfrFeature getFeature()
      Return the JfrFeature this handler is associated with.
    • test

      default boolean test(RecordedEvent event)
      Test to see if this event is interesting to this mapper
      Specified by:
      test in interface Predicate<RecordedEvent>
      Parameters:
      event - - event instance to see if we're interested
      Returns:
      true if event is interesting, false otherwise
    • getPollingDuration

      default Optional<Duration> getPollingDuration()
      Optionally returns a polling duration for JFR events, if present
      Returns:
      Optional of Duration representing polling duration; empty Optional if no polling
    • getThreshold

      default Optional<Duration> getThreshold()
      Optionally returns a threshold length for JFR events, if present
      Returns:
      Optional of Duration representing threshold; empty Optional if no threshold
    • closeObservables

      static void closeObservables(List<AutoCloseable> observables)
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable