Search in sources :

Example 1 with ExactMethodInfo

use of com.newrelic.agent.profile.method.ExactMethodInfo in project newrelic-java-agent by newrelic.

the class ProfiledMethodFactory method getMethodInfo.

public MethodInfo getMethodInfo(ClassMethodSignature methodSignature) {
    MethodInfo methodInfo = methodInfos.get(methodSignature);
    if (null == methodInfo) {
        Type[] argumentTypes = Type.getArgumentTypes(methodSignature.getMethodDesc());
        List<String> arguments = new ArrayList<>(argumentTypes.length);
        for (Type t : argumentTypes) {
            arguments.add(t.getClassName());
        }
        methodInfo = new ExactMethodInfo(arguments, (InstrumentedMethod) null);
        MethodInfo previous = methodInfos.putIfAbsent(methodSignature, methodInfo);
        if (previous != null) {
            return previous;
        }
    }
    return methodInfo;
}
Also used : Type(org.objectweb.asm.Type) ExactMethodInfo(com.newrelic.agent.profile.method.ExactMethodInfo) ArrayList(java.util.ArrayList) InstrumentedMethod(com.newrelic.agent.instrumentation.InstrumentedMethod) ExactMethodInfo(com.newrelic.agent.profile.method.ExactMethodInfo) MethodInfo(com.newrelic.agent.profile.method.MethodInfo)

Aggregations

InstrumentedMethod (com.newrelic.agent.instrumentation.InstrumentedMethod)1 ExactMethodInfo (com.newrelic.agent.profile.method.ExactMethodInfo)1 MethodInfo (com.newrelic.agent.profile.method.MethodInfo)1 ArrayList (java.util.ArrayList)1 Type (org.objectweb.asm.Type)1