code: def test_histogram(init_firstly):
      if init_firstly:
          init_metrics()
      h = Metrics.histogram("test_histogram")
      assert h.name == "test_histogram"
      assert h.description == ""
      assert h.tag_keys == ()
      assert h.type == "Histogram"
      if not init_firstly:
          init_metrics()
      h.record(1)
      assert h.value == 0
      for i in range(2002):
          h.record(1)
      assert h.value > 0
  
file_path: mars/mars/metrics/tests/test_metric_api.py
imports: import pytest
  from random import random
  from ..None import api
  from ..api import init_metrics, Metrics, _percentile_builder, Percentile, record_time_cost_percentile, shutdown_metrics
label_desc: Use image node_id 6 for calling a global function with example usage: test_histogram(init_firstly) without return types