class Metrics implements Closeable {

    public void removeSensor(String name) {
        Sensor sensor = sensors.get(name);
        if (sensor != null) {
            List<Sensor> childSensors = null;
            synchronized (sensor) {
                synchronized (this) {
                    if (sensors.remove(name, sensor)) {
                        for (KafkaMetric metric : sensor.metrics())
                            removeMetric(metric.metricName());
                        log.debug("Removed sensor with name {}", name);
                        childSensors = childrenSensors.remove(sensor);
                    }
                }
            }
            if (childSensors != null) {
                for (Sensor childSensor : childSensors)
                    removeSensor(childSensor.name());
            }
        }
    }

    public  Metrics();
    public  Metrics(Time time);
    public  Metrics(MetricConfig defaultConfig, Time time);
    public  Metrics(MetricConfig defaultConfig);
    public  Metrics(MetricConfig defaultConfig, List<MetricsReporter> reporters, Time time);
    public  Metrics(MetricConfig defaultConfig, List<MetricsReporter> reporters, Time time, boolean enableExpiration);

}