container/src/main/java/com/streamsets/datacollector/metrics/MetricsConfigurator.java
private static boolean remove(final MetricRegistry metrics, final String name, String pipelineName, String pipelineRev) {
    final String jmxNamePrefix = jmxPipelinePrefix(pipelineName, pipelineRev);
    final MetricRegistry metricRegistry = sdcMetrics;
    if (metricRegistry != null) {
      AccessController.doPrivileged(new PrivilegedAction<Void>() {
        @Override
        public Void run() {
          metricRegistry.remove(jmxNamePrefix  + name);
          return null;
        }
      });
    }
    return metrics.remove(name);
  }
private static boolean remove(final MetricRegistry metrics, final String name, String pipelineName, String pipelineRev) {
    final String jmxNamePrefix = jmxPipelinePrefix(pipelineName, pipelineRev);
    final MetricRegistry metricRegistry = sdcMetrics;
    if (metricRegistry != null) {
      AccessController.doPrivileged(new PrivilegedAction<Void>() {
        @Override
        public Void run() {
          metricRegistry.remove(jmxNamePrefix  + name);
          return null;
        }
      });
    }
    return metrics.remove(name);
  }
private static boolean remove ( final MetricRegistry metrics , final String name , String pipelineName , String pipelineRev ) { final String jmxNamePrefix = jmxPipelinePrefix ( pipelineName , pipelineRev ) ; final MetricRegistry metricRegistry = sdcMetrics ; if ( metricRegistry != null ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { metricRegistry . remove ( jmxNamePrefix + name ) ; return null ; } } ) ; } return metrics . remove ( name ) ; }
Remove metric object (regardless of it's type)
Remove metric object ( regardless of it s type )