Alluxio / Community

New Contributor Tasks for Alluxio
20 stars 38 forks source link

Inline all string members of `alluxio.metrics.MetricKey.Name` #600

Closed apc999 closed 3 years ago

apc999 commented 3 years ago

class alluxio.metrics.MetricKey.Name is currently used as a placeholder for all string names of each alluxio.metrics.MetricKey. In practise, having this placeholder class is unnecessary and actually making adding a new metrics more complicated. Given all members in this class are only used in `alluxio.metrics.MetricKey, this issue aims to simplify the class by inlining all occurrences of these members.

For example, to inline Name.MASTER_ABSENT_CACHE_HITS, we can change

  public static final MetricKey MASTER_ABSENT_CACHE_HITS =
      new Builder(Name.MASTER_ABSENT_CACHE_HITS)
          .setDescription("Number of cache hits on the absent cache")
          .setMetricType(MetricType.COUNTER)
          .build();

to

  public static final MetricKey MASTER_ABSENT_CACHE_HITS =
      new Builder("Master.AbsentCacheHits")
          .setDescription("Number of cache hits on the absent cache")
          .setMetricType(MetricType.COUNTER)
          .build();