Example #1
0
        /// <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)));
        }
Example #2
0
        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));
        }
Example #3
0
 private static MethodProfilerInfo <T> GetMethodProfileInfo(MethodInfo methodInfo)
 {
     return(_cache[MethodProfilerInfo <T> .CreateMethodProfileInfoKey(methodInfo)]);
 }