Class VisitorTypeRequests

java.lang.Object
org.frontcache.bots.VisitorTypeRequests

public final class VisitorTypeRequests extends Object
Top-level requests by visitor type (the leaf), counted where the type is decided - what the exporter reports as frontcache_visitor_requests_total{type} (2.13.0). Top-level only, for the reason the rate limiter has scope=toplevel: a fragment re-entering the engine is the same visitor again, so counting includes would count a visitor once per fragment of their page. Warm requests are not visitors and are not counted. Bounded: a type is counted only once classification gave it, so the names are the roots and the declared types (at most 16 + 2 at a time); the map keeps a name a reload removed, so its counter stays monotonic, and refuses a new one past MAX_NAMES - many reloads of many renames - rather than grow.
  • Field Details

    • MAX_NAMES

      public static final int MAX_NAMES
      The most names ever counted in one process.
      See Also:
  • Method Details

    • count

      public static void count(String visitorType)
      One top-level request of this type. Allocates only the first time a name is seen.
    • requests

      public static long requests(String visitorType)
      Returns:
      the requests counted for the type since the process started, 0 for a name never counted
    • names

      public static Set<String> names()
      Returns:
      every name counted so far
    • reset

      public static void reset()
      for tests