/// <summary> /// Return the numnber of calls sites for a /// </summary> /// <param name="methodDescriptor"></param> /// <param name="projectName"></param> /// <returns></returns> public static async Task <int> GetInvocationCountAsync(ISolutionManager solutionManager, MethodDescriptor methodDescriptor) { var totalStopWatch = Stopwatch.StartNew(); var stopWatch = Stopwatch.StartNew(); var entityWithPropagator = await solutionManager.GetMethodEntityAsync(methodDescriptor); Meausure("GetMethodEntityProp", stopWatch); var result = await entityWithPropagator.GetInvocationCountAsync(); Meausure("entProp.GetInvocationCountAsync", stopWatch); Meausure("Total GetInvocationCountAsync", totalStopWatch); return(result); }
/// These 2 method can work either with Orleans or OndDemandAsync Strategy /// <summary> /// Return the calless for a given call site /// </summary> /// <param name="solutionManager"></param> /// <param name="methodDescriptor"></param> /// <param name="invocationPosition"></param> /// <returns></returns> public static async Task <ISet <MethodDescriptor> > GetCalleesAsync(ISolutionManager solutionManager, MethodDescriptor methodDescriptor, int invocationPosition) { var totalStopWatch = Stopwatch.StartNew(); var stopWatch = Stopwatch.StartNew(); var entityWithPropagator = await solutionManager.GetMethodEntityAsync(methodDescriptor); Meausure("GetMethodEntityProp", stopWatch); var result = await entityWithPropagator.GetCalleesAsync(invocationPosition); Meausure("entProp.GetCalleesAsync", stopWatch); stopWatch.Stop(); Meausure("Total GetCalleesAsync", totalStopWatch); return(result); }