@Override
    public synchronized void stop() {
        if (!monitoring) {
            LOG.warn(prefix + " metrics system not yet started!", new MetricsException("Illegal stop"));
            return;
        }
        for (Callback cb : callbacks)
            cb.preStop();
        LOG.info("Stopping " + prefix + " metrics system...");
        stopTimer();
        stopSources();
        stopSinks();
        clearConfigs();
        monitoring = false;
        LOG.info(prefix + " metrics system stopped.");
        for (Callback cb : callbacks)
            cb.postStop();
    }