private synchronized void configureSinks() {
        sinkConfigs = config.getInstanceConfigs(MetricsConfig.SINK_KEY);
        int confPeriod = 0;
        for (Entry<String, MetricsConfig> entry : sinkConfigs.entrySet()) {
            MetricsConfig conf = entry.getValue();
            int sinkPeriod = conf.getInt(MetricsConfig.PERIOD_KEY, MetricsConfig.PERIOD_DEFAULT);
            confPeriod = confPeriod == 0 ? sinkPeriod : MathUtils.gcd(confPeriod, sinkPeriod);
            String sinkName = entry.getKey();
            LOG.debug("sink " + sinkName + " config:\n" + conf);
            try {
                MetricsSinkAdapter sa = newSink(sinkName, conf.getString(MetricsConfig.DESC_KEY, sinkName), conf);
                // we allow config of later registered sinks
                if (sa != null) {
                    sa.start();
                    sinks.put(sinkName, sa);
                }
            } catch (Exception e) {
                LOG.warn("Error creating " + sinkName, e);
            }
        }
        period = confPeriod > 0 ? confPeriod : config.getInt(MetricsConfig.PERIOD_KEY, MetricsConfig.PERIOD_DEFAULT);
    }