class_docstr: The client monitor watches the cluster status.
  
  Attributes:
      status (dict): A dict to store workers status and clients status.
class_docstr_tok: ["The","client","monitor","watches","the","cluster","status",".","Attributes",":","status","(","dict",")",":","A","dict","to","store","workers","status","and","clients","status","."]
docstr: Record worker status when it is connected to the cluster.
  
  Args:
      worker_address (str): worker ip address
      hostname (str): worker hostname 
      total_cpus(int): the number of CPU in the worker
      total_gpus(int): the number of GPU in the worker
docstr_tok: ["Record","worker","status","when","it","is","connected","to","the","cluster",".","Args",":","worker_address","(","str",")",":","worker","ip","address","hostname","(","str",")",":","worker","hostname","total_cpus","(","int",")",":","the","number","of","CPU","in","the","worker","total_gpus","(","int",")",":","the","number","of","GPU","in","the","worker"]
code: def add_worker_status(
      self, worker_address, hostname, total_cpus, total_gpus
  ):
      """Record worker status when it is connected to the cluster.
  
      Args:
          worker_address (str): worker ip address
          hostname (str): worker hostname
          total_cpus(int): the number of CPU in the worker
          total_gpus(int): the number of GPU in the worker
      """
      self.lock.acquire()
      worker_status = self.status["workers"][worker_address]
      worker_status["load_value"] = deque(maxlen=10)
      worker_status["load_time"] = deque(maxlen=10)
      worker_status["hostname"] = hostname
      worker_status["vacant_cpus"] = total_cpus
      worker_status["used_cpus"] = 0
      worker_status["vacant_gpus"] = total_gpus
      worker_status["used_gpus"] = 0
      self.lock.release()
  
file_path: PARL/parl/remote/cluster_monitor.py
imports: import cloudpickle
  import threading
  from collections import defaultdict, deque
  from parl.utils import to_str
label_desc: Use image node_id 2 for calling the ClusterMonitor obj's underlying member method code with example usage: obj.add_worker_status(worker_address, hostname, total_cpus, total_gpus) without return types