GrowthTracker
Ecng.Logging
Tracks the high-watermark for a set of named counters and emits a warning only when a counter crosses the next doubling tier (1000 → 2000 → 4000 → …). Thread-safe. One instance per class replaces N separate long watermark fields.
Constructors
GrowthTracker
public GrowthTracker(long firstTier, int multiplier)
growthTracker = GrowthTracker(firstTier, multiplier)
Initializes a new instance.
- firstTier
- First threshold that triggers a warning (default 1000).
- multiplier
- Multiplier for successive tiers (default 2 = doubling).
Methods
CheckTier
public long CheckTier(string name, long current)
result = growthTracker.CheckTier(name, current)
Checks whether has crossed the next tier for the counter identified by . Returns the crossed tier value, or 0 if no tier was crossed.
Reset
public void Reset(string name)
growthTracker.Reset(name)
Resets the watermark for the specified counter.