Class CrawlerStatsHelper.StatsObject

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Long>, SequencedMap<String,Long>
Enclosing class:
CrawlerStatsHelper

public static class CrawlerStatsHelper.StatsObject extends LinkedHashMap<String,Long>
Statistics data object that stores timestamped events and maintains reference counting. Extends LinkedHashMap to store event names mapped to their timestamps. Includes reference counting for multi-threaded access tracking.
See Also:
  • Field Details

    • count

      protected final AtomicInteger count
      Atomic counter for tracking reference count across multiple threads.
  • Constructor Details

    • StatsObject

      public StatsObject()
      Creates a new statistics object with the current timestamp as the begin time. Initializes the reference count to 1.
  • Method Details

    • increment

      public int increment()
      Increments the reference count for this statistics object.
      Returns:
      the new reference count after incrementing
    • decrement

      public int decrement()
      Decrements the reference count for this statistics object.
      Returns:
      the new reference count after decrementing