code: def test_metrics(client: TestClient) -> None:
      response = client.request("get", "/metrics")
      assert response.status_code == 200
      text = response.text
      lines = text.split("\n")
      metrics = {
          line.split(" ")[0]: float(line.split(" ")[1])
          for line in lines
          if line and line[0] != "#"
      }
  
      # the middleware should have recorded the request
      name = 'starlette_requests_total{method="GET",path_template="/metrics"}'
      assert name in metrics, metrics
      assert metrics[name] > 0, metrics
  
file_path: datasets-server/services/admin/tests/test_app.py
imports: from typing import Optional
  import pytest
  from libcommon.processing_graph import processing_graph
  from starlette.testclient import TestClient
  from admin.app import create_app
label_desc: Use image node_id 4 for calling a global function with example usage: test_metrics(client) without return types