public static Counter counter(Metrics metrics, String component, String methodName) {
    if (metrics != null) {
      return metrics.getCounter(component, methodName);
    } else {
      return null;
    }
  }
public static Counter counter ( Metrics metrics , String component , String methodName ) { if ( metrics != null ) { return metrics . getCounter ( component , methodName ) ; } else { return null ; } }
if metrics is not null returns a Counter instance for a given component and method name.

@param metrics factory instance to get timer.
@param component name for the requested timer.
@param methodName for the requested timer.
@return counter instance.