code: def test_gauge(init_firstly):
      if init_firstly:
          init_metrics()
      g = Metrics.gauge("test_gauge", "A test gauge")
      assert g.name == "test_gauge"
      assert g.description == "A test gauge"
      assert g.tag_keys == ()
      assert g.type == "Gauge"
      if not init_firstly:
          init_metrics()
      g.record(1)
      assert g.value == 1
      g.record(2)
      assert g.value == 2
  
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 4 for calling a global function with example usage: test_gauge(init_firstly) without return types