class_docstr: A running estimate of performance (operations/sec) using adjusted exponential moving average
  :param alpha: Smoothing factor in range [0, 1], [default: 0.1].
docstr: Update the EMA throughput of a code that runs inside the context manager, supports multiple concurrent threads.
  
  :param task_size: how many items were processed since last call
docstr_tok: ["Update","the","EMA","throughput","of","a","code","that","runs","inside","the","context","manager",",","supports","multiple","concurrent","threads",".",":","param","task_size",":","how","many","items","were","processed","since","last","call"]
code: def update_threadsafe(self, task_size: float):
      """
      Update the EMA throughput of a code that runs inside the context manager, supports multiple concurrent threads.
  
      :param task_size: how many items were processed since last call
      """
      start_timestamp = time.perf_counter()
      yield
      with self.lock:
          self.update(
              task_size,
              interval=time.perf_counter()
              - max(start_timestamp, self.timestamp),
          )
  
file_path: hivemind/hivemind/utils/performance_ema.py
imports: import time
  from contextlib import contextmanager
  from threading import Lock
  from typing import Optional
label_desc: Use image node_id 6 for calling the PerformanceEMA obj's underlying member method code with example usage: obj.update_threadsafe(task_size) without return types