code: def test_get_metrics_report(
      mock_prometheus_client: MagicMock,
      simple_service: Service,
      serve_kind: str,
      expected: dict[str, str | float] | None,
      generated_metrics: t.Generator[Metric, None, None],
  ):
      mock_prometheus_client.multiproc.return_value = False
      mock_prometheus_client.text_string_to_metric_families.return_value = (
          generated_metrics
      )
      output = analytics.usage_stats.get_metrics_report(
          mock_prometheus_client, serve_kind=serve_kind
      )
      if expected:
          assert expected in output
  
imports: from __future__ import annotations
  import logging
  import typing
  from typing import TYPE_CHECKING
  from unittest.mock import Mock
  from unittest.mock import patch
  import pytest
  from prometheus_client.parser import text_string_to_metric_families
  from schema import And
  from schema import Or
  from schema import Schema
  import bentoml
  from bentoml._internal.utils import analytics
label_desc: Use image node_id 11 for calling a global function with example usage: test_get_metrics_report(mock_prometheus_client, simple_service, serve_kind, expected, generated_metrics) without return types