code: def collect(self) -> Iterator[CounterMetricFamily]:
      from prometheus_client.core import CounterMetricFamily
  
      try:
          stealing: WorkStealing = self.server.extensions["stealing"]
      except KeyError:
          return
  
      stealing_request_count_total = CounterMetricFamily(
          self.build_name("request_count_total"),
          "Total number of stealing requests per cost multiplier.",
          labels=["cost_multiplier"],
      )
  
      stealing_request_cost_total = CounterMetricFamily(
          self.build_name("request_cost_total"),
          "Total cost of stealing requests per cost multiplier.",
          labels=["cost_multiplier"],
      )
  
      for level, multiplier in enumerate(stealing.cost_multipliers):
          stealing_request_count_total.add_metric(
              [str(multiplier)],
              stealing.metrics["request_count_total"][level],
          )
  
          stealing_request_cost_total.add_metric(
              [str(multiplier)],
              stealing.metrics["request_cost_total"][level],
          )
  
      yield stealing_request_count_total
      yield stealing_request_cost_total
  
file_path: distributed/distributed/http/scheduler/prometheus/stealing.py
imports: from __future__ import annotations
  from collections.abc import Iterator
  from typing import TYPE_CHECKING
  from distributed.http.prometheus import PrometheusCollector
  from distributed.stealing import WorkStealing
label_desc: Use image node_id 2 for calling the WorkStealingMetricCollector obj's underlying member method code with example usage: obj.collect() without return types