public static void registerGauge(String key,Gauge g){
  try {
    MetricRegistry reg=SharedMetricRegistries.getOrCreate("okapi");
    reg.removeMatching(null);
    reg.register(key,g);
  }
 catch (  Exception e) {
    logger.warn("registerGauge caught an exception: " + e.getMessage());
  }
}

public static void registerGauge ( String key , Gauge g ) { try { MetricRegistry reg = SharedMetricRegistries . getOrCreate ( "okapi" ) ; reg . removeMatching ( null ) ; reg . register ( key , g ) ; } catch ( Exception e ) { logger . warn ( "registerGauge caught an exception: " + e . getMessage ( ) ) ; } }
register a gauge . that is , a number of some sort that gets polled at intervals , and reported to graphite . for example , the number of known modules .
