/// <summary> /// Gets execution history of supplied <paramref name="objectToProfile"/> and <paramref name="methodInfo"/> /// </summary> /// <param name="profiledObject">Object that was profiled</param> /// <param name="methodInfo">Method info to retrieve history</param> /// <returns></returns> public static IEnumerable <IMethodExecutionHistory> GetHistory(T profiledObject, MethodInfo methodInfo) { ThrowNotInterfaceException(); return(GetMethodProfileInfo(methodInfo) .GetHistory(MethodProfilerInfo <T> .BuilLambdaObjectAndMethodKey()(profiledObject, methodInfo))); }
public override IMessage Invoke(IMessage msg) { var methodCall = msg as IMethodCallMessage; var methodInfo = methodCall.MethodBase as MethodInfo; MethodProfilerInfo <T> methodProfileInfo; if ((methodProfileInfo = GetMethodProfileInfo(methodInfo)) == null) { methodProfileInfo = new MethodProfilerInfo <T>(methodInfo); _cache.Add(methodProfileInfo.MethodProfileInfoKey, methodProfileInfo); } return(methodProfileInfo.BuiltExpression(_profiledObject, methodProfileInfo, methodInfo, methodCall)); }
private static MethodProfilerInfo <T> GetMethodProfileInfo(MethodInfo methodInfo) { return(_cache[MethodProfilerInfo <T> .CreateMethodProfileInfoKey(methodInfo)]); }