Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

build test deploy Maven Central

bootique-metrics

Provides Dropwizard Metrics integration module for Bootique. See usage example bootique-metrics-demo.

Quick Start:

Add the Metrics module to your Bootique app:

<dependency>
	<groupId>io.bootique.metrics</groupId>
	<artifactId>bootique-metrics</artifactId>
	<scope>compile</scope>
</dependency>

Inject MetricRegistry anywhere in your code where you need to create Meters, Gauges, Counters, Histograms, Timers, etc. E.g.:

@Inject
public MyObject(MetricRegistry metrics) {
	this.timer = metrics.timer(MetricRegistry.name(RequestTimer.class, "work-timer"));
}
...
public void doWork() {
	Timer.Context context = this.timer.time();
	try {
		// do work
	} finally {
		long timeNanos = context.stop();
	}
}