code: def __init__(self, dashboard_agent):
      super().__init__(dashboard_agent)
      self._event_dir = os.path.join(
          self._dashboard_agent.log_dir, "events"
      )
      os.makedirs(self._event_dir, exist_ok=True)
      self._monitor: Union[asyncio.Task, None] = None
      self._stub: Union[
          event_pb2_grpc.ReportEventServiceStub, None
      ] = None
      self._cached_events = asyncio.Queue(
          event_consts.EVENT_AGENT_CACHE_SIZE
      )
      self._gcs_aio_client = dashboard_agent.gcs_aio_client
      self.monitor_thread_pool_executor = ThreadPoolExecutor(
          max_workers=1, thread_name_prefix="event_monitor"
      )
      # Total number of event created from this agent.
      self.total_event_reported = 0
      # Total number of event report request sent.
      self.total_request_sent = 0
      self.module_started = time.monotonic()
  
      logger.info(
          "Event agent cache buffer size: %s",
          self._cached_events.maxsize,
      )
  
file_path: ray/python/ray/dashboard/modules/event/event_agent.py
imports: import asyncio
  import time
  from concurrent.futures import ThreadPoolExecutor
  import logging
  import os
  from typing import Union
  import ray._private.ray_constants
  import ray._private.utils
  import ray.dashboard.consts
  import ray.dashboard.utils
  from ray.core.generated import event_pb2, event_pb2_grpc
  from ray.dashboard.modules.event import event_consts
  from ray.dashboard.modules.event.event_utils import monitor_events
  from ray.dashboard.utils import async_loop_forever, create_task
label_desc: Use image node_id 1 to create a new EventAgent object from inherited base classes: dashboard_utils with example: obj = EventAgent(dashboard_agent)