class_docstr: Worker extension for spans support
class_docstr_tok: ["Worker","extension","for","spans","support"]
docstr: Apportion the metrics that do have a span to the Spans on the scheduler
  
  Returns
  -------
  ``{(context, span_id, prefix, activity, unit): value}}``
  
  See Also
  --------
  SpansSchedulerExtension.heartbeat
  Span.cumulative_worker_metrics
  distributed.worker.Worker.get_metrics
docstr_tok: ["Apportion","the","metrics","that","do","have","a","span","to","the","Spans","on","the","scheduler","Returns","--","--","--","-","``","{","(","context",",","span_id",",","prefix",",","activity",",","unit",")",":","value","}","}","``","See","Also","--","--","--","--","SpansSchedulerExtension.heartbeat","Span.cumulative_worker_metrics","distributed.worker.Worker.get_metrics"]
code: def heartbeat(self) -> dict[tuple[Hashable, ...], float]:
      """Apportion the metrics that do have a span to the Spans on the scheduler
  
      Returns
      -------
      ``{(context, span_id, prefix, activity, unit): value}}``
  
      See Also
      --------
      SpansSchedulerExtension.heartbeat
      Span.cumulative_worker_metrics
      distributed.worker.Worker.get_metrics
      """
      out = self.digests_total_since_heartbeat
      self.digests_total_since_heartbeat = {}
      return out
  
imports: from __future__ import annotations
  import uuid
  import weakref
  from collections import defaultdict
  from collections.abc import Hashable, Iterable, Iterator
  from contextlib import contextmanager
  from itertools import islice
  from typing import TYPE_CHECKING, Any
  import dask.config
  from dask.typing import Key
  from distributed.collections import sum_mappings
  from distributed.itertools import ffill
  from distributed.metrics import time
label_desc: Use image node_id 3 for calling the SpansWorkerExtension obj's underlying member method code with example usage: obj.heartbeat() and returns: out