code: def collect_crick(self) -> Iterator[Metric]:
      # All metrics using digests require crick to be installed.
      # The following metrics will export NaN, if the corresponding digests are None
      if not self.crick_available:
          return
      assert self.server.digests
  
      yield GaugeMetricFamily(
          self.build_name("tick_duration_median"),
          "Median tick duration at worker",
          unit="seconds",
          value=self.server.digests["tick-duration"]
          .components[1]
          .quantile(50),
      )
  
      yield GaugeMetricFamily(
          self.build_name("task_duration_median"),
          "Median task runtime at worker",
          unit="seconds",
          value=self.server.digests["task-duration"]
          .components[1]
          .quantile(50),
      )
  
      yield GaugeMetricFamily(
          self.build_name("transfer_bandwidth_median"),
          "Bandwidth for transfer at worker",
          unit="bytes",
          value=self.server.digests["transfer-bandwidth"]
          .components[1]
          .quantile(50),
      )
  
imports: from __future__ import annotations
  import logging
  from collections.abc import Iterator
  from time import time
  from typing import ClassVar
  import prometheus_client
  from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, Metric
  from distributed.http.prometheus import PrometheusCollector
  from distributed.http.utils import RequestHandler
  from distributed.worker import Worker
label_desc: Use image node_id 3 for calling the WorkerMetricCollector obj's underlying member method code with example usage: obj.collect_crick() without return types