class_docstr: Efficiently estimates the Ray serialized size of a stream of items.
  
  For efficiency, this only samples a fraction of the added items for real
  Ray-serialization.
class_docstr_tok: ["Efficiently","estimates","the","Ray","serialized","size","of","a","stream","of","items",".","For","efficiency",",","this","only","samples","a","fraction","of","the","added","items","for","real","Ray-serialization","."]
code: def add(self, item: Any) -> None:
      self._count += 1
      if self._count <= 10:
          self._running_mean.add(self._real_size(item), weight=1)
      elif self._count <= 100:
          if self._count % 10 == 0:
              self._running_mean.add(self._real_size(item), weight=10)
      elif self._count % 100 == 0:
          self._running_mean.add(self._real_size(item), weight=100)
  
file_path: ray/python/ray/data/_internal/size_estimator.py
imports: from typing import Any, List
  import ray
  from ray import cloudpickle
label_desc: Use image node_id 2 for calling the SizeEstimator obj's underlying member method code with example usage: obj.add(item) without return types