class_docstr: Gather spill statistics
  
  Levels of information gathered:
    0  - disabled (no overhead).
    1+ - duration and number of bytes spilled (very low overhead).
    2+ - a traceback for each time a spillable buffer is exposed
         permanently (potential high overhead).
  
  The statistics are printed when spilling-on-demand fails to find
  any buffer to spill. It is possible to retrieve the statistics
  manually through the spill manager, see example below.
  
  Parameters
  ----------
  level : int
      If not 0, enables statistics at the specified level.
  
  Examples
  --------
  >>> import cudf
  >>> from cudf.core.buffer.spill_manager import get_global_manager
  >>> manager = get_global_manager()
  >>> manager.statistics
  <SpillStatistics level=1>
  >>> df = cudf.DataFrame({"a": [1,2,3]})
  >>> manager.spill_to_device_limit(1)  # Spill df
  24
  >>> print(get_global_manager().statistics)
  Spill Statistics (level=1):
   Spilling (level >= 1):
    gpu => cpu: 24B in 0.0033579860000827466s
class_docstr_tok: ["Gather","spill","statistics","Levels","of","information","gathered",":","0","-","disabled","(","no","overhead",")",".","1+","-","duration","and","number","of","bytes","spilled","(","very","low","overhead",")",".","2+","-","a","traceback","for","each","time","a","spillable","buffer","is","exposed","permanently","(","potential","high","overhead",")",".","The","statistics","are","printed","when","spilling-on-demand","fails","to","find","any","buffer","to","spill",".","It","is","possible","to","retrieve","the","statistics","manually","through","the","spill","manager",",","see","example","below",".","Parameters","--","--","--","--","--","level",":","int","If","not","0",",","enables","statistics","at","the","specified","level",".","Examples","--","--","--","--",">",">",">","import","cudf",">",">",">","from","cudf.core.buffer.spill_manager","import","get_global_manager",">",">",">","manager","=","get_global_manager","(",")",">",">",">","manager.statistics","<","SpillStatistics","level=1",">",">",">",">","df","=","cudf.DataFrame","(","{","``","a","''",":","[","1,2,3","]","}",")",">",">",">","manager.spill_to_device_limit","(","1",")","#","Spill","df","24",">",">",">","print","(","get_global_manager","(",")",".statistics",")","Spill","Statistics","(","level=1",")",":","Spilling","(","level",">","=","1",")",":","gpu","=",">","cpu",":","24B","in","0.0033579860000827466s"]
code: def __repr__(self) -> str:
      return f"<SpillStatistics level={self.level}>"
  
imports: from __future__ import annotations
  import gc
  import io
  import textwrap
  import threading
  import traceback
  import warnings
  import weakref
  from collections import defaultdict
  from dataclasses import dataclass
  from functools import partial
  from typing import Dict, List, Optional, Tuple
  import rmm.mr
  from cudf.core.buffer.spillable_buffer import SpillableBufferOwner
  from cudf.options import get_option
  from cudf.utils.nvtx_annotation import _cudf_nvtx_annotate
  from cudf.utils.string import format_bytes
label_desc: Use image node_id 4 for calling the SpillStatistics obj's underlying member method code with example usage: obj.__repr__() and returns: str, self, str