private void initContextWith(boolean enabled, int intervalInSeconds, String prefix) { addEnvironment(this.context, "graphite.enabled:" + enabled, "graphite.host:localhost", "graphite.port:" + serverStub.getPort(), "graphite.report-interval:" + intervalInSeconds, "graphite.prefix:" + prefix); context.register(MetricsDropwizardAutoConfiguration.class,GraphiteAutoConfigure.class); context.refresh(); }