use of com.newrelic.agent.profile.method.MethodInfo in project newrelic-java-agent by newrelic.
the class ProfiledMethodFactory method getProfiledMethod.
public ProfiledMethod getProfiledMethod(Tracer tracer) {
ClassMethodSignature methodSignature = tracer.getClassMethodSignature();
ProfiledMethod method = getTracerMethods().get(methodSignature);
if (method == null) {
StackTraceElement stackTraceElement = new StackTraceElement(methodSignature.getClassName(), methodSignature.getMethodName(), null, -1);
method = ProfiledMethod.newProfiledMethod(getNextMethodId(), profile, stackTraceElement);
if (method != null) {
ProfiledMethod previous = getTracerMethods().putIfAbsent(methodSignature, method);
if (null != previous) {
method = previous;
} else {
MethodInfo methodInfo = getMethodInfo(methodSignature);
method.setMethodInfo(methodInfo);
}
}
}
return method;
}
use of com.newrelic.agent.profile.method.MethodInfo 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;
}
Aggregations