Exemplo n.º 1
0
 internal static void MsmqRejectedMessage(string uri)
 {
     if (PerformanceCounters.Scope == PerformanceCounterScope.All)
     {
         ServiceModelPerformanceCountersEntry counters = PerformanceCounters.GetServiceModelPerformanceCountersBaseUri(uri);
         if (null != counters)
         {
             counters.ServicePerformanceCounters.MsmqRejectedMessage();
         }
     }
 }
Exemplo n.º 2
0
        internal static void MessageDropped(string uri)
        {
            ServiceModelPerformanceCountersEntry counters = PerformanceCounters.GetServiceModelPerformanceCountersBaseUri(uri);

            if (null != counters)
            {
                counters.ServicePerformanceCounters.MessageDropped();
                if (PerformanceCounters.Scope == PerformanceCounterScope.All)
                {
                    List <ServiceModelPerformanceCounters> counters2 = counters.CounterList;
                    foreach (ServiceModelPerformanceCounters sCounters in counters2)
                    {
                        if (sCounters.EndpointPerformanceCounters != null)
                        {
                            sCounters.EndpointPerformanceCounters.MessageDropped();
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        static void CallOnAllCounters(string methodName, Message message, Uri listenUri, bool includeOperations)
        {
            Fx.Assert(null != message, "message must not be null");
            Fx.Assert(null != listenUri, "listenUri must not be null");
            if (null != message && null != message.Headers && null != message.Headers.To && null != listenUri)
            {
                string uri = listenUri.AbsoluteUri.ToUpperInvariant();

                ServiceModelPerformanceCountersEntry counters = PerformanceCounters.GetServiceModelPerformanceCountersBaseUri(uri);
                if (null != counters)
                {
                    Fx.Assert(null != counters.ServicePerformanceCounters, "counters.ServicePerformanceCounters must not be null");
                    PerformanceCounters.InvokeMethod(counters.ServicePerformanceCounters, methodName);

                    if (PerformanceCounters.Scope == PerformanceCounterScope.All)
                    {
                        List <ServiceModelPerformanceCounters> counters2 = counters.CounterList;
                        foreach (ServiceModelPerformanceCounters sCounters in counters2)
                        {
                            if (sCounters.EndpointPerformanceCounters != null)
                            {
                                PerformanceCounters.InvokeMethod(sCounters.EndpointPerformanceCounters, methodName);
                            }

                            if (includeOperations)
                            {
                                OperationPerformanceCountersBase oCounters = sCounters.GetOperationPerformanceCountersFromMessage(message);
                                if (oCounters != null)
                                {
                                    PerformanceCounters.InvokeMethod(oCounters, methodName);
                                }
                            }
                        }
                    }
                }
            }
        }