Class TrashRemovalStatisticThreadLocal


  • public class TrashRemovalStatisticThreadLocal
    extends Object
    Hold statistics for a running trash removal job
    Since:
    7.14.0
    • Constructor Detail

      • TrashRemovalStatisticThreadLocal

        public TrashRemovalStatisticThreadLocal()
    • Method Detail

      • withStatistic

        public static void withStatistic​(@Nullable TrashRemovalStatistic stats,
                                         Runnable runnable)
        Perform some trash removal actions while recording statistics into a stats holder
        Parameters:
        stats - an object to hold statistics for current job
        runnable - some actions whose effects will be recorded
      • getCurrentStatistic

        public static Optional<TrashRemovalStatistic> getCurrentStatistic()
        Returns:
        statistics holder for current trash removal job, if any