AdamBien / perceptor

Java EE Performance Measuring Interceptor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

perceptor

Java EE Performance Measuring Interceptor

installation

To gather statistics without automatically exposing them use the following dependency:

<dependency>
    <groupId>com.airhacks</groupId>
    <artifactId>perceptor</artifactId>
    <version>[RECENT]</version>
</dependency>

The statistics become available via injection:

import com.airhacks.interceptor.monitoring.control.InvocationMonitoring;

public class MonitoringResource {

    @Inject
    InvocationMonitoring mes;
}

The perceptor-spy dependency gathers statistics and exposes them via the /monitoring/methods endpoint:

<dependency>
    <groupId>com.airhacks</groupId>
    <artifactId>perceptor-spy</artifactId>
    <version>[RECENT]</version>
</dependency>

usage

import com.airhacks.interceptor.monitoring.boundary.PerformanceSensor;

@Interceptors(PerformanceSensor.class)
public class Invoker {


    public String slow() {}

    public String fast() {}

}

statistics API

all method invocations:

curl [THIN_WAR]/resources/monitoring/methods

all method invocations, sorted by timestamp:

curl [THIN_WAR]/resources/monitoring/methods/recent

slowest methods:

curl [THIN_WAR]/resources/monitoring/methods/slowest

methods throwing exceptions:

curl [THIN_WAR]/resources/monitoring/methods/exceptional

methods throwing exceptions, sorted by exception amount:

curl [THIN_WAR]/resources/monitoring/methods/unstable

See you at Java EE Performance, Monitoring and Troubleshooting and/or Java EE Microservices workshops

About

Java EE Performance Measuring Interceptor

License:Apache License 2.0


Languages

Language:Java 96.0%Language:HTML 4.0%