Beispiel #1
0
        internal static void MethodCalled(string operationName)
        {
            EndpointDispatcher el = GetEndpointDispatcher();

            if (null != el)
            {
                if (PerformanceCounters.Scope == PerformanceCounterScope.All)
                {
                    string uri = el.PerfCounterId;
                    OperationPerformanceCountersBase opCounters = PerformanceCounters.GetOperationPerformanceCounters(el.PerfCounterInstanceId, operationName);
                    if (null != opCounters)
                    {
                        opCounters.MethodCalled();
                    }
                    EndpointPerformanceCountersBase eCounters = PerformanceCounters.GetEndpointPerformanceCounters(el.PerfCounterInstanceId);
                    if (null != eCounters)
                    {
                        eCounters.MethodCalled();
                    }
                }
                ServicePerformanceCountersBase sCounters = PerformanceCounters.GetServicePerformanceCounters(el.PerfCounterInstanceId);
                if (null != sCounters)
                {
                    sCounters.MethodCalled();
                }
            }
        }
Beispiel #2
0
        internal static void MethodCalled(string operationName)
        {
            EndpointDispatcher endpointDispatcher = GetEndpointDispatcher();

            if (endpointDispatcher != null)
            {
                if (Scope == PerformanceCounterScope.All)
                {
                    string perfCounterId = endpointDispatcher.PerfCounterId;
                    OperationPerformanceCountersBase operationPerformanceCounters = GetOperationPerformanceCounters(endpointDispatcher.PerfCounterInstanceId, operationName);
                    if (operationPerformanceCounters != null)
                    {
                        operationPerformanceCounters.MethodCalled();
                    }
                    EndpointPerformanceCountersBase endpointPerformanceCounters = GetEndpointPerformanceCounters(endpointDispatcher.PerfCounterInstanceId);
                    if (endpointPerformanceCounters != null)
                    {
                        endpointPerformanceCounters.MethodCalled();
                    }
                }
                ServicePerformanceCountersBase servicePerformanceCounters = GetServicePerformanceCounters(endpointDispatcher.PerfCounterInstanceId);
                if (servicePerformanceCounters != null)
                {
                    servicePerformanceCounters.MethodCalled();
                }
            }
        }