Class Stats


  • public final class Stats
    extends java.lang.Object
    Class for accessing the default StatsComponent.
    Since:
    0.8
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
    • Constructor Detail

      • Stats

        private Stats()
    • Method Detail

      • setState

        @Deprecated
        public static void setState​(StatsCollectionState state)
        Deprecated.
        This method is deprecated because other libraries could cache the result of getState(), use a stale value, and behave incorrectly. It is only safe to call early in initialization. This method throws IllegalStateException after getState() has been called, in order to limit changes to the result of getState().
        Sets the current StatsCollectionState.

        When no implementation is available, setState does not change the state.

        If state is set to StatsCollectionState.DISABLED, all stats that are previously recorded will be cleared.

        Parameters:
        state - the new StatsCollectionState.
        Throws:
        java.lang.IllegalStateException - if getState() was previously called.
        Since:
        0.8
      • loadStatsComponent

        static StatsComponent loadStatsComponent​(@Nullable
                                                 java.lang.ClassLoader classLoader)