roda
roda copied to clipboard
Enhance/enrich RODA metrics
ATM, only metrics about Jobs are being generated (e.g. #jobsBeingExecuted, jobsTimeInTheQueueInMilis, etc.; available via jmx & REST endpoint). And for that, we are using dropwizard metrics library. But besides Jobs, there are lots of other components in RODA that could/should be measured in order to be monitored, and one of them is already & easily provided by dropwizard metrics: jersey 2 (REST API).
To measure how much time is spent to executing a method (and statistics about it), one can add the following Maven dependency
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jersey2</artifactId>
<version>3.2.6</version>
</dependency>
registering in REST API (RestApplication.java) a new listener
register(new InstrumentedResourceMethodApplicationListener(RodaCoreFactory.getMetrics()));
and annotating each *Resource.java methods with
@Timed