All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dropwizard.metrics.ReporterFactory Maven / Gradle / Ivy

There is a newer version: 0.40.13
Show newest version
package io.dropwizard.metrics;

import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.ScheduledReporter;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.dropwizard.jackson.Discoverable;
import io.dropwizard.util.Duration;

import java.util.Optional;

/**
 * A service provider interface for creating metrics {@link ScheduledReporter reporters}.
 * 

* To create your own, just: *

    *
  1. Create a class which implements {@link ReporterFactory}.
  2. *
  3. Annotate it with {@code @JsonTypeName} and give it a unique type name.
  4. *
  5. Add a {@code META-INF/services/io.dropwizard.metrics.ReporterFactory} * file with your implementation's full class name to the class path.
  6. *
* * @see ConsoleReporterFactory * @see CsvReporterFactory * @see Slf4jReporterFactory */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") public interface ReporterFactory extends Discoverable { /** * Returns the frequency for reporting metrics. * * @return the frequency for reporting metrics. */ Optional getFrequency(); /** * Configures and builds a {@link ScheduledReporter} instance for the given registry. * * @param registry the metrics registry to report metrics from. * * @return a reporter configured for the given metrics registry. */ ScheduledReporter build(MetricRegistry registry); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy