Counter - Reporter

Scale Counter Graph

About

A reporter is a collector that:

Example

Dropwizard

Dropwizard has ScheduledReporter

Example:

// Initialize Dropwizard metric registry
String registryName = "registry";
MetricRegistry registry = SharedMetricRegistries.getOrCreate(registryName);
SharedMetricRegistries.setDefault(registryName);

// Initialize Dropwizard reporter
Logger dropWizardlogger = LoggerFactory.getLogger(DropWizard.class);

// The reporter
Slf4jReporter reporter = Slf4jReporter.forRegistry(registry)
  .outputTo(dropWizardlogger)
  .convertRatesTo(TimeUnit.SECONDS)
  .convertDurationsTo(TimeUnit.MILLISECONDS)
  .build();
reporter.start(1, TimeUnit.MINUTES);
  • with the CsvReporter, it doesn't write to a file, but instead writes a series of files to a specified directory.
String registryName = "vertx";
MetricRegistry registry = SharedMetricRegistries.getOrCreate(registryName);
SharedMetricRegistries.setDefault(registryName);

// A directory path
Path csvPath = Paths.get("logs");

// The reporter
CsvReporter reporter = CsvReporter.forRegistry(registry)
  .convertRatesTo(TimeUnit.SECONDS)
  .convertDurationsTo(TimeUnit.MILLISECONDS)
  .build(csvPath.toFile());

// Start
reporter.start(1, TimeUnit.MINUTES);





Discover More
Scale Counter Graph
Counter - Collector

Metrics collector query and collects metrics in order to be able to send them to a metrics server Log Collector In a instrumented application, reporter are a client piece of code which: process...
Scale Counter Graph
Metrics Server

Metrics Server This page is software that can store and visualize counter (metrics. The collectors that sends data to a metrics server are: Metrics Collector Log Collector Instrumentation...
Java Conceptuel Diagram
Vert.x - Metrics

in Vertx. By default Vert.x does not record any metrics. Instead it provides an SPI for others to implement which can be added to the classpath. The metrics SPI is an advanced feature which allows implementers...



Share this page:
Follow us:
Task Runner