Search in sources :

Example 1 with LongMethodProbe

use of com.hazelcast.internal.metrics.impl.MethodProbe.LongMethodProbe in project hazelcast by hazelcast.

the class MethodProbeTest method getLong.

public void getLong(String methodName, int expectedValue) throws Exception {
    SomeSource source = new SomeSource();
    Method method = source.getClass().getDeclaredMethod(methodName);
    Probe probe = method.getAnnotation(Probe.class);
    MethodProbe methodProbe = createMethodProbe(method, probe, new SourceMetadata(SomeSource.class));
    LongMethodProbe longMethodProbe = assertInstanceOf(LongMethodProbe.class, methodProbe);
    long value = longMethodProbe.get(source);
    assertEquals(expectedValue, value);
}
Also used : MethodProbe.createMethodProbe(com.hazelcast.internal.metrics.impl.MethodProbe.createMethodProbe) LongMethodProbe(com.hazelcast.internal.metrics.impl.MethodProbe.LongMethodProbe) LongMethodProbe(com.hazelcast.internal.metrics.impl.MethodProbe.LongMethodProbe) Method(java.lang.reflect.Method) MethodProbe.createMethodProbe(com.hazelcast.internal.metrics.impl.MethodProbe.createMethodProbe) LongMethodProbe(com.hazelcast.internal.metrics.impl.MethodProbe.LongMethodProbe) Probe(com.hazelcast.internal.metrics.Probe)

Aggregations

Probe (com.hazelcast.internal.metrics.Probe)1 LongMethodProbe (com.hazelcast.internal.metrics.impl.MethodProbe.LongMethodProbe)1 MethodProbe.createMethodProbe (com.hazelcast.internal.metrics.impl.MethodProbe.createMethodProbe)1 Method (java.lang.reflect.Method)1