public <T> AutoGauge createAutoGauge(
      String name, MetricLevel metricLevel, T obj, ToDoubleFunction<T> mapper, String... tags) {
    if (invalid(metricLevel, name, tags)) {
      return DoNothingMetricManager.DO_NOTHING_AUTO_GAUGE;
    }
    MetricInfo metricInfo = new MetricInfo(MetricType.AUTO_GAUGE, name, tags);
    AutoGauge gauge = createAutoGauge(obj, mapper);
    nameToMetaInfo.put(name, metricInfo.getMetaInfo());
    metrics.put(metricInfo, gauge);
    notifyReporterOnAdd(gauge, metricInfo);
    return gauge;
  }
Create autoGauge

<p>AutoGauge keep a weak reference of the obj, so it will not prevent gc of the obj. Notice: if
you call this gauge's value() when the obj has already been cleared by gc, then you will get
0L.

@param name the name of name
@param metricLevel the level of name
@param obj which will be monitored automatically
@param mapper use which to map the obj to a double value
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/AbstractMetricManager.java