code: def test_spill_stats(object_spilling_config, shutdown_only):
      # Limit our object store to 75 MiB of memory.
      object_spilling_config, _ = object_spilling_config
      address = ray.init(
          num_cpus=1,
          object_store_memory=100 * 1024 * 1024,
          _system_config={
              "automatic_object_spilling_enabled": True,
              "max_io_workers": 100,
              "min_spilling_size": 1,
              "object_spilling_config": object_spilling_config,
          },
      )
  
      @ray.remote
      def f():
          return np.zeros(50 * 1024 * 1024, dtype=np.uint8)
  
      ids = []
      for _ in range(4):
          x = f.remote()
          ids.append(x)
  
      while ids:
          print(ray.get(ids.pop()))
  
      x_id = f.remote()  # noqa
      ray.get(x_id)
      s = memory_summary(address=address["address"], stats_only=True)
      assert "Plasma memory usage 50 MiB, 1 objects, 50.0% full" in s, s
      assert "Spilled 200 MiB, 4 objects" in s, s
      assert "Restored 150 MiB, 3 objects" in s, s
  
      # Test if consumed bytes are correctly calculated.
      obj = ray.put(np.zeros(30 * 1024 * 1024, dtype=np.uint8))
  
      @ray.remote
      def func_with_ref(obj):
          return True
  
      ray.get(func_with_ref.remote(obj))
  
      s = memory_summary(address=address["address"], stats_only=True)
      # 50MB * 5 references + 30MB used for task execution.
      assert "Objects consumed by Ray tasks: 280 MiB." in s, s
      assert_no_thrashing(address["address"])
  
imports: import copy
  import json
  import platform
  import random
  import sys
  from datetime import datetime, timedelta
  from unittest.mock import patch
  import numpy
  import pytest
  import ray
  from ray._private.external_storage import create_url_with_offset, parse_url_with_offset, _get_unique_spill_filename, FileSystemStorage, ExternalStorageSmartOpenImpl
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import wait_for_condition
  from ray._raylet import GcsClientOptions
  from ray.tests.conftest import buffer_object_spilling_config, file_system_object_spilling_config, mock_distributed_fs_object_spilling_config
label_desc: Use image node_id 15 for calling a global function with example usage: test_spill_stats(object_spilling_config, shutdown_only) and returns: np, True