code: def test_multi_node_stats(shutdown_only):
      # NOTE(mwtian): using env var only enables the feature on workers, while
      # using head_node_args={"_system_config": ray_config} only enables the
      # feature on the driver.
      os.environ["RAY_record_ref_creation_sites"] = "1"
      cluster = Cluster()
      for _ in range(2):
          cluster.add_node(num_cpus=1)
  
      ray.init(address=cluster.address)
  
      @ray.remote(num_cpus=1)
      class Actor:
          def __init__(self):
              self.ref = ray.put(np.zeros(100000))
  
          def ping(self):
              pass
  
      # Each actor will be on a different node.
      a = Actor.remote()
      b = Actor.remote()
      ray.get(a.ping.remote())
      ray.get(b.ping.remote())
  
      # Verify we have collected stats across the nodes.
      info = memory_summary(cluster.address)
      print(info)
      assert count(info, PUT_OBJ) == 2, info
  
file_path: ray/python/ray/tests/test_memstat.py
imports: import os
  import time
  import numpy
  import pytest
  import ray
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import Semaphore, wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 9 for calling a global function with example usage: test_multi_node_stats(shutdown_only) without return types