示例#1
0
        private void InitializeActorMethodInfo(DiagnosticsEventManager diagnosticsEventManager)
        {
            this.actorMethodCounterInstanceData = new Dictionary <long, CounterInstanceData>();
            var methodInfoList = new List <KeyValuePair <long, MethodInfo> >();

            foreach (var actorInterfaceType in this.actorTypeInformation.InterfaceTypes)
            {
                int interfaceId;
                MethodDescription[] actorInterfaceMethodDescriptions;
                diagnosticsEventManager.ActorMethodFriendlyNameBuilder.GetActorInterfaceMethodDescriptions(actorInterfaceType, out interfaceId, out actorInterfaceMethodDescriptions);
                foreach (var actorInterfaceMethodDescription in actorInterfaceMethodDescriptions)
                {
                    var kvp = new KeyValuePair <long, MethodInfo>(
                        DiagnosticsEventManager.GetInterfaceMethodKey((uint)interfaceId, (uint)actorInterfaceMethodDescription.Id),
                        actorInterfaceMethodDescription.MethodInfo);
                    methodInfoList.Add(kvp);
                }
            }

            // Compute the counter instance names for all the actor methods
            var percCounterInstanceNameBuilder = new PerformanceCounterInstanceNameBuilder(this.partitionId, this.counterInstanceDifferentiator);
            var counterInstanceNames           = percCounterInstanceNameBuilder.GetActorMethodCounterInstanceNames(methodInfoList);

            foreach (var kvp in counterInstanceNames)
            {
                this.actorMethodCounterInstanceData[kvp.Key] = new CounterInstanceData {
                    InstanceName = kvp.Value
                };
            }
        }
示例#2
0
        internal List <KeyValuePair <long, MethodInfo> > GetMethodInfo(
            MethodDescription[] actorInterfaceMethodDescriptions, int interfaceId)

        {
            var methodInfoList = new List <KeyValuePair <long, MethodInfo> >();

            foreach (var actorInterfaceMethodDescription in actorInterfaceMethodDescriptions)
            {
                var kvp = new KeyValuePair <long, MethodInfo>(
                    DiagnosticsEventManager.GetInterfaceMethodKey((uint)interfaceId,
                                                                  (uint)actorInterfaceMethodDescription.Id),
                    actorInterfaceMethodDescription.MethodInfo);
                methodInfoList.Add(kvp);
                //For V2 InterfaceId Support
            }
            return(methodInfoList);
        }
示例#3
0
        internal void InitializeActorMethodInfo(MethodDescription[] actorInterfaceMethodDescriptions, int interfaceId,
                                                Dictionary <long, ActorMethodInfo> actorMethodInfos)
        {
            foreach (var actorInterfaceMethodDescription in actorInterfaceMethodDescriptions)
            {
                var methodInfo = actorInterfaceMethodDescription.MethodInfo;
                var ami        = new ActorMethodInfo()
                {
                    MethodName      = String.Concat(methodInfo.DeclaringType.Name, ".", methodInfo.Name),
                    MethodSignature = actorInterfaceMethodDescription.MethodInfo.ToString()
                };

                var key =
                    DiagnosticsEventManager.GetInterfaceMethodKey((uint)interfaceId,
                                                                  (uint)actorInterfaceMethodDescription.Id);
                actorMethodInfos[key] = ami;
            }
        }
        private void InitializeActorMethodInfo(DiagnosticsEventManager diagnosticsEventManager)
        {
            this.actorMethodInfo = new Dictionary <long, ActorMethodInfo>();
            foreach (var actorInterfaceType in this.actorTypeInformation.InterfaceTypes)
            {
                int interfaceId;
                MethodDescription[] actorInterfaceMethodDescriptions;
                diagnosticsEventManager.ActorMethodFriendlyNameBuilder.GetActorInterfaceMethodDescriptions(
                    actorInterfaceType, out interfaceId, out actorInterfaceMethodDescriptions);

                foreach (var actorInterfaceMethodDescription in actorInterfaceMethodDescriptions)
                {
                    var methodInfo = actorInterfaceMethodDescription.MethodInfo;
                    var ami        = new ActorMethodInfo()
                    {
                        MethodName      = String.Concat(methodInfo.DeclaringType.Name, ".", methodInfo.Name),
                        MethodSignature = actorInterfaceMethodDescription.MethodInfo.ToString()
                    };

                    var key = DiagnosticsEventManager.GetInterfaceMethodKey((uint)interfaceId, (uint)actorInterfaceMethodDescription.Id);
                    this.actorMethodInfo[key] = ami;
                }
            }
        }