Beispiel #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
                };
            }
        }
 internal DiagnosticsManager(ActorService actorService)
 {
     this.diagnosticsEventManager = new DiagnosticsEventManager(actorService.MethodFriendlyNameBuilder);
     this.perfCounterProvider     = new PerformanceCounterProvider(actorService.Context.PartitionId, actorService.ActorTypeInformation);
     this.perfCounterProvider.RegisterWithDiagnosticsEventManager(this.diagnosticsEventManager);
     this.eventSourceProvider = new EventSourceProvider(actorService.Context, actorService.ActorTypeInformation);
     this.eventSourceProvider.RegisterWithDiagnosticsEventManager(this.diagnosticsEventManager);
 }
 internal override void InitializeActorMethodInfo(DiagnosticsEventManager diagnosticsEventManager)
 {
     foreach (var actorInterfaceType in this.actorTypeInformation.InterfaceTypes)
     {
         int interfaceId;
         MethodDescription[] actorInterfaceMethodDescriptions;
         diagnosticsEventManager.ActorMethodFriendlyNameBuilder.GetActorInterfaceMethodDescriptionsV2(
             actorInterfaceType, out interfaceId, out actorInterfaceMethodDescriptions);
         this.InitializeActorMethodInfo(actorInterfaceMethodDescriptions, interfaceId, this.actorMethodInfoV2);
     }
     base.InitializeActorMethodInfo(diagnosticsEventManager);
 }
Beispiel #4
0
        internal virtual 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);
                this.InitializeActorMethodInfo(actorInterfaceMethodDescriptions, interfaceId, this.actorMethodInfo);
            }
        }
Beispiel #5
0
        internal void RegisterWithDiagnosticsEventManager(DiagnosticsEventManager diagnosticsEventManager)
        {
            this.InitializeActorMethodInfo(diagnosticsEventManager);

            diagnosticsEventManager.OnActorChangeRole                += this.OnActorChangeRole;
            diagnosticsEventManager.OnActorActivated                 += this.OnActorActivated;
            diagnosticsEventManager.OnActorDeactivated               += this.OnActorDeactivated;
            diagnosticsEventManager.OnActorMethodStart               += this.OnActorMethodStart;
            diagnosticsEventManager.OnActorMethodFinish              += this.OnActorMethodFinish;
            diagnosticsEventManager.OnSaveActorStateStart            += this.OnSaveActorStateStart;
            diagnosticsEventManager.OnSaveActorStateFinish           += this.OnSaveActorStateFinish;
            diagnosticsEventManager.OnPendingActorMethodCallsUpdated += this.OnPendingActorMethodCallsUpdated;
        }
Beispiel #6
0
        internal void RegisterWithDiagnosticsEventManager(DiagnosticsEventManager diagnosticsEventManager)
        {
            this.InitializeActorMethodInfo(diagnosticsEventManager);

            diagnosticsEventManager.OnActorMethodFinish += this.OnActorMethodFinish;
            diagnosticsEventManager.OnPendingActorMethodCallsUpdated += this.OnPendingActorMethodCallsUpdated;
            diagnosticsEventManager.OnSaveActorStateFinish           += this.OnSaveActorStateFinish;
            diagnosticsEventManager.OnActorRequestProcessingStart    += this.OnActorRequestProcessingStart;
            diagnosticsEventManager.OnActorRequestProcessingFinish   += this.OnActorRequestProcessingFinish;
            diagnosticsEventManager.OnActorLockAcquired += this.OnActorLockAcquired;
            diagnosticsEventManager.OnActorLockReleased += this.OnActorLockReleased;
            diagnosticsEventManager.OnActorRequestDeserializationFinish += this.OnActorRequestDeserializationFinish;
            diagnosticsEventManager.OnActorResponseSerializationFinish  += this.OnActorResponseSerializationFinish;
            diagnosticsEventManager.OnActorOnActivateAsyncFinish        += this.OnActorOnActivateAsyncFinish;
            diagnosticsEventManager.OnLoadActorStateFinish += this.OnLoadActorStateFinish;
        }
Beispiel #7
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);
        }
Beispiel #8
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;
            }
        }
Beispiel #9
0
        internal virtual 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);
                methodInfoList.AddRange(this.GetMethodInfo(actorInterfaceMethodDescriptions, interfaceId));
            }

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

            this.actorMethodCounterInstanceData =
                this.CreateActorMethodCounterInstanceData(methodInfoList, percCounterInstanceNameBuilder);
        }
        internal override void InitializeActorMethodInfo(DiagnosticsEventManager diagnosticsEventManager)
        {
            base.InitializeActorMethodInfo(diagnosticsEventManager);

            this.actorMethodCounterInstanceDataV2 = new Dictionary <long, CounterInstanceData>();

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

            foreach (var actorInterfaceType in this.actorTypeInformation.InterfaceTypes)
            {
                int interfaceIdV2;
                MethodDescription[] actorInterfaceMethodDescriptions;
                diagnosticsEventManager.ActorMethodFriendlyNameBuilder.GetActorInterfaceMethodDescriptionsV2(actorInterfaceType,
                                                                                                             out interfaceIdV2,
                                                                                                             out actorInterfaceMethodDescriptions);
                methodInfoListV2.AddRange(this.GetMethodInfo(actorInterfaceMethodDescriptions, interfaceIdV2));
            }
            var percCounterInstanceNameBuilderV2 =
                new PerformanceCounterInstanceNameBuilder(this.partitionId, this.counterInstanceDifferentiatorV2, PerformanceCounterInstanceNameBuilder.DefaultMaxInstanceNameVariablePartsLen - 3);

            this.actorMethodCounterInstanceDataV2 = this.CreateActorMethodCounterInstanceData(methodInfoListV2, percCounterInstanceNameBuilderV2);
        }
        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;
                }
            }
        }
Beispiel #12
0
 internal MockDiagnosticsManager(ActorService actorService)
 {
     this.diagnosticsEventManager = new DiagnosticsEventManager(actorService.MethodFriendlyNameBuilder);
 }