trackTimestamp method

void trackTimestamp(
  1. String eventName,
  2. int tsMillis
)

Record a timestamp for an event name.

Implementation

void trackTimestamp(String eventName, int tsMillis) {
  // Remove first so re-insertion moves to end (most recent)
  _timestamps.remove(eventName);
  if (_timestamps.length >= _maxEntries) {
    // Evict oldest inserted entry (first key in insertion order)
    _timestamps.remove(_timestamps.keys.first);
  }
  _timestamps[eventName] = tsMillis;
}