Skip to content

Instantly share code, notes, and snippets.

View autoletics's full-sized avatar

William David Louth autoletics

View GitHub Profile
import org.jinspired.probes.Probes;
private static final Probes.Name NAME = Probes.name(C.class).name("m").name("b");
private void m() {
// ...
b: {
Probes.Probe p = Probes.begin(NAME);
try {
// the code execution metered
import org.jinspired.probes.spi.*;
import org.jinspired.probes.*;
import java.lang.reflect.Method;
public final class ProviderFactory implements ProbesProviderFactory {
public ProbesProvider create() {/*..*/}
private static final class Provider implements ProbesProvider {
import org.jinspired.probes.interceptor.*;
import org.jinspired.probes.*;
public final class InterceptorFactory implements ProbesInterceptorFactory {
public void init(Probes.Environment env) {/*..*/}
public ProbesInterceptor create(Probes.Context ctx) {/*..*/}
private static final class Interceptor implements ProbesInterceptor {
import org.jinspired.probes.strategy.*;
import org.jinspired.probes.*;
public final class StrategyFactory implements ProbesStrategyFactory {
public void init(Probes.Environment env) {/*..*/}
public ProbesStrategy create(Probes.Context ctx) {/*..*/}
private static final class Strategy implements ProbesStrategy {
import org.jinspired.probes.measure.*;
import org.jinspired.probes.*;
public final class MeasureFactory implements ProbesMeasureFactory {
public void init(Probes.Environment env) {/*..*/}
public ProbesMeasure create(Probes.Context context) {/*..*/}
private static final class Measure implements ProbesMeasure {
import org.jinspired.probes.*;
public final class Counting {
private static final Probes.Name FN_COUNT = Probes.name("fn").name("count");
public Object fn() {
//...
if(/*...*/) { Probes.context().counter(FN_COUNT).inc(); }
//...
@autoletics
autoletics / spi.sh
Last active January 25, 2017 09:49
java -Dorg.jinspired.probes.spi.factory=<fully-qualified-factory-classname> ...
j.s.p.interceptor.enabled=true
j.s.p.interceptors=i
j.s.p.interceptor.i.factory.class=<fully-qualified-factory-classname>
j.s.p.interceptor.i.factory.classpath=<dir-or-lib-factory-classpath>
j.s.p.strategy.enabled=true
j.s.p.strategies=s
j.s.p.strategy.s.factory.class=<fully-qualified-factory-classname>
j.s.p.strategy.s.factory.classpath=<dir-or-lib-factory-classpath>
j.s.p.measure.enabled=true
j.s.p.measures=s
j.s.p.measure.s.factory.class=<fully-qualified-factory-classname>
j.s.p.measure.s.factory.classpath=<dir-or-lib-factory-classpath>