Skip to content

bootique/bootique-metrics

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?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit 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();
	}
}

About

Provides Dropwizard Metrics integration with Bootique

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages