Exemplo n.º 1
0
        internal static void MethodReturnedFault(string operationName, long time)
        {
            EndpointDispatcher el = GetEndpointDispatcher();

            if (null != el)
            {
                if (PerformanceCounters.Scope == PerformanceCounterScope.All)
                {
                    string uri = el.PerfCounterId;
                    OperationPerformanceCountersBase counters = PerformanceCounters.GetOperationPerformanceCounters(el.PerfCounterInstanceId, operationName);
                    if (null != counters)
                    {
                        counters.MethodReturnedFault();
                        if (time > 0)
                        {
                            counters.SaveCallDuration(time);
                        }
                    }
                    EndpointPerformanceCountersBase eCounters = PerformanceCounters.GetEndpointPerformanceCounters(el.PerfCounterInstanceId);
                    if (null != eCounters)
                    {
                        eCounters.MethodReturnedFault();
                        if (time > 0)
                        {
                            eCounters.SaveCallDuration(time);
                        }
                    }
                }
                ServicePerformanceCountersBase sCounters = PerformanceCounters.GetServicePerformanceCounters(el.PerfCounterInstanceId);
                if (null != sCounters)
                {
                    sCounters.MethodReturnedFault();
                    if (time > 0)
                    {
                        sCounters.SaveCallDuration(time);
                    }
                }
            }
        }
Exemplo n.º 2
0
        internal static void MethodReturnedFault(string operationName, long time)
        {
            EndpointDispatcher endpointDispatcher = GetEndpointDispatcher();

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