class

KemalWAF::ShardedIPStateMap

Inherits Reference / Object

============================================================================= Sharded IP State Map

Reduces lock contention by distributing IP states across multiple shards

Constructors

new(default_limit : Int32, default_window_sec : Int32)
Source

Instance methods

cleanup(now : Time, max_age_sec : Int32, max_duration_ms : Int32 = EVICTION_MAX_DURATION_MS) : Int32

Cleanup stale entries (with time budget)

Source
delete(key : String)

Delete counter

Source
each_with_prefix(prefix : String, &block : String, SlidingWindowCounter -> )

Iterate over all keys matching prefix

Source
get(key : String) : SlidingWindowCounter | Nil

Get existing counter (returns nil if not found)

Source
get_or_create(key : String, limit : Int32 | Nil = nil, window_sec : Int32 | Nil = nil) : SlidingWindowCounter

Get or create counter for key

Source
size

Get total count of entries

Source