Question about implementing your own profilers

Zoltan Farkas zolyfarkas at yahoo.com
Mon Nov 3 22:02:48 UTC 2014


Hi I have implemented my own profiler interface (JmhProfiler <http://zolyfarkas.github.io/spf4j/xref/org/spf4j/stackmonitor/JmhProfiler.html>) generated the META-INF/service file, and when I was trying to use my profiler from the command line it looks like my profiler is not picked up...

I noticed that loadInstalled is being used instead of load at ProfilerFactory line 57 (kmh 1.1.1):

    public static List<Class<? extends Profiler>> getDiscoveredProfilers() {
        List<Class<? extends Profiler>> profs = new ArrayList<Class<? extends Profiler>>();
        for (Profiler s : ServiceLoader.loadInstalled(Profiler.class))
            profs.add(s.getClass());
        return profs;
    }

this method however looks in dire/lib/ext for the implementation, and not in the entire class path… (if load would be used my profiler implementation would be found...)

is this on purpose?

let me know, thank you

—Z


More information about the jmh-dev mailing list