Crypto Server
    Preparing search index...

    Class MeteringEngine

    In-memory tenant store using a sliding-window token bucket algorithm.

    The store is bounded: once it holds maxTenants entries, the least recently used tenant is evicted. An evicted tenant starts again with a full bucket, so the bound trades a little precision for fixed memory.

    Index
    • Evaluates whether a request from tenantKey, which must come from the authenticated principal, is within its quota, and records it if so. The payload size is only counted: the server's body limit bounds it.

      Parameters

      • tenantKey: string
      • OptionalcontentLength: number
      • nowMs: number = ...

      Returns MeteringCheckResult