class_docstr: A monitor process for monitoring Ray nodes.
  
  Attributes:
      dashboard_agent: The DashboardAgent object contains global config
class_docstr_tok: ["A","monitor","process","for","monitoring","Ray","nodes",".","Attributes",":","dashboard_agent",":","The","DashboardAgent","object","contains","global","config"]
code: def _get_workers(self):
      raylet_proc = self._get_raylet_proc()
  
      if raylet_proc is None:
          return []
      else:
          workers = {
              self._generate_worker_key(proc): proc
              for proc in raylet_proc.children()
          }
  
          # We should keep `raylet_proc.children()` in `self` because
          # when `cpu_percent` is first called, it returns the meaningless 0.
          # See more: https://github.com/ray-project/ray/issues/29848
          keys_to_pop = []
          # Add all new workers.
          for key, worker in workers.items():
              if key not in self._workers:
                  self._workers[key] = worker
  
          # Pop out stale workers.
          for key in self._workers:
              if key not in workers:
                  keys_to_pop.append(key)
          for k in keys_to_pop:
              self._workers.pop(k)
  
          # Remove the current process (reporter agent), which is also a child of
          # the Raylet.
          self._workers.pop(
              self._generate_worker_key(self._get_agent_proc())
          )
  
          result = []
          for w in self._workers.values():
              try:
                  if w.status() == psutil.STATUS_ZOMBIE:
                      continue
              except psutil.NoSuchProcess:
                  # the process may have terminated due to race condition.
                  continue
  
              result.append(
                  w.as_dict(
                      attrs=[
                          "pid",
                          "create_time",
                          "cpu_percent",
                          "cpu_times",
                          "cmdline",
                          "memory_info",
                          "memory_full_info",
                          "num_fds",
                      ]
                  )
              )
          return result
  
imports: import asyncio
  import datetime
  import json
  import logging
  import os
  import socket
  import sys
  import traceback
  import psutil
  from typing import List, Optional, Tuple, TypedDict, Union
  from collections import defaultdict
  import ray
  import ray._private.services
  import ray._private.utils
  from ray.dashboard.consts import GCS_RPC_TIMEOUT_SECONDS, COMPONENT_METRICS_TAG_KEYS
  from ray.dashboard.modules.reporter.profile_manager import CpuProfilingManager, MemoryProfilingManager
  import ray.dashboard.modules.reporter.reporter_consts
  import ray.dashboard.utils
  from opencensus.stats import stats
  import ray._private.prometheus_exporter
  from prometheus_client.core import REGISTRY
  from ray._private.metrics_agent import Gauge, MetricsAgent, Record
  from ray._private.ray_constants import DEBUG_AUTOSCALING_STATUS
  from ray.core.generated import reporter_pb2, reporter_pb2_grpc
  from ray.dashboard import k8s_utils
  from ray._raylet import WorkerID
label_desc: Use image node_id 11 for calling the ReporterAgent obj's underlying member method code with example usage: obj._get_workers() and returns: list, result