class MetricsConf {

  @Bean
  ScheduledReporterFactory runningScheduledReporterFactory(
      MetricRegistry runningMetricRegistry,
      ValidatedGraphite validatedGraphite) {
    if (validatedGraphite.isEnabled()) {
      return new GraphiteScheduledReporterFactory(runningMetricRegistry, validatedGraphite.getHost(),
          validatedGraphite.getFormattedPrefix());
    }
    return new LoggingScheduledReporterFactory(runningMetricRegistry);
  }

}