CI Statuses
Latest Stable
Current Development
Ametiste metrics is a library for easy metrics registration from any point of client code.
Library at a glance is described here, for more detailed description view wiki
To register a metric for a method, one of following annotations may be applied to it:
- @Countable
- @ErrorCountable
- @Timeable
- @Chronable
- @Gaugeable
@Countable is used when incremental count is required - on any joint point, such is request count, method call count, and so on. Only counts number of successfully executed operations.
@ErrorCountable is used when count of executions completed with exceptions is required - works similarly to @Countable but for joint points ended with errors.
@Timeable is used when method execution time is required.
@Chronable is used to chronate data from flow. Value of chronable data is regulated by its value or value expression, i.e. can be any event data that is to be saved in timeline (method arguments or execution result numerical values, counts or phase of moon, etc)
@Gaugeable is used to measure executions with gauge. Only successful operations are measured.
Example:
@Timeable(name="my.neat.metric")
public void justAMethod(String parameter) {
}
For further annotation usage details view Annotation examples
Metrics library can be used directly, without annotations, by injecting metrics service to client code. For more detailed library description and custom configuration view Ametiste metrics wiki
All non experimental dependencies is accessible at bintray central.
repositories {
mavenCentral()
jcenter()
}
compile ""org.ametiste.metrics:metrics-default-starter:${metricsVersion}"
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<dependency>
<groupId>org.ametiste.metrics</groupId>
<artifactId>metrics-default-starter</artifactId>
<version>metrics.version</version>
</dependency>
Aspects and metric service should be configured to start using metrics annotations. There are several ways to use metrics service, from easiest to most specific.
Adding 'org.ametiste.metrics:metrics-default-starter:{metricsVersion}'
dependency in classpath of spring boot project provides it with default most commonly used configuration, and if autoconfiguration is enabled, it requires no further actions for usage. For more details and alternative usages view Installation and configuration wiki page