Class MetricsEnvironment

    • Constructor Detail

      • MetricsEnvironment

        public MetricsEnvironment()
    • Method Detail

      • setProcessWideContainer

        public static @Nullable MetricsContainer setProcessWideContainer​(@Nullable MetricsContainer container)
        Set the MetricsContainer for the current process.
        Returns:
        The previous container for the current process.
      • setMetricsSupported

        public static void setMetricsSupported​(boolean supported)
        Called by the run to indicate whether metrics reporting is supported.
      • isMetricsSupported

        public static boolean isMetricsSupported()
        Indicates whether metrics reporting is supported.
      • scopedMetricsContainer

        public static java.io.Closeable scopedMetricsContainer​(MetricsContainer container)
        Set the MetricsContainer for the current thread.
        Returns:
        A Closeable that will reset the current container to the previous MetricsContainer when closed.
      • getCurrentContainer

        public static @Nullable MetricsContainer getCurrentContainer()
        Return the MetricsContainer for the current thread.

        May return null if metrics are not supported by the current runner or if the current thread is not a work-execution thread. The first time this happens in a given thread it will log a diagnostic message.