class_docstr: Utility that aggregates related log messages to reduce log spam.
docstr: Add a log message, which is throttled once per interval by a key.
  
  Args:
      message: The message to log.
      key: The key to use to deduplicate the message.
      interval_s: Throttling interval in seconds.
docstr_tok: ["Add","a","log","message",",","which","is","throttled","once","per","interval","by","a","key",".","Args",":","message",":","The","message","to","log",".","key",":","The","key","to","use","to","deduplicate","the","message",".","interval_s",":","Throttling","interval","in","seconds","."]
code: def add_once_per_interval(
      self, message: str, key: str, interval_s: int
  ):
      """Add a log message, which is throttled once per interval by a key.
  
      Args:
          message: The message to log.
          key: The key to use to deduplicate the message.
          interval_s: Throttling interval in seconds.
      """
      with self.lock:
          if key not in self.throttled_messages:
              self.throttled_messages[key] = time.time() + interval_s
              self.messages_to_send.append(message)
  
file_path: ray/python/ray/autoscaler/_private/event_summarizer.py
imports: import time
  from threading import RLock
  from typing import Any, Callable, Dict, List
label_desc: Use image node_id 3 for calling the EventSummarizer obj's underlying member method code with example usage: obj.add_once_per_interval(message, key, interval_s) without return types