Ejemplo n.º 1
0
        static void DecrementCounter(ref PerformanceCounter counter)
        {
            if (counter != null)
            {
                try
                {
                    counter.Decrement();
                }
#pragma warning suppress 56500 // covered by FxCOP
                catch (Exception exception)
                {
                    if (Fx.IsFatal(exception))
                    {
                        throw;
                    }

                    ListenerPerfCounters.TracePerformanceCounterUpdateFailure(counter.InstanceName, counter.CounterName);
                    counter = null;
                }
            }
        }
Ejemplo n.º 2
0
        static ListenerPerfCounters()
        {
            if (ListenerConfig.PerformanceCountersEnabled)
            {
                ListenerPerfCounters.AddCounterToList(perfCounterConnectionsDispatchedTcp       = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.ConnectionsDispatchedTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterConnectionsDispatchedNamedPipe = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.ConnectionsDispatchedNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterDispatchFailuresTcp            = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.DispatchFailuresTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterDispatchFailuresNamedPipe      = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.DispatchFailuresNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterUrisRegisteredTcp            = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.UrisRegisteredTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterUrisRegisteredNamedPipe      = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.UrisRegisteredNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterUrisUnregisteredTcp          = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.UrisUnregisteredTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterUrisUnregisteredNamedPipe    = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.UrisUnregisteredNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterRegistrationsActiveTcp       = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.RegistrationsActiveTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterRegistrationsActiveNamedPipe = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.RegistrationsActiveNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterConnectionsAcceptedTcp       = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.ConnectionsAcceptedTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterConnectionsAcceptedNamedPipe = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.ConnectionsAcceptedNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterProtocolFailuresTcp          = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.ProtocolFailuresTcp, string.Empty, PerformanceCounterInstanceLifetime.Global));
                ListenerPerfCounters.AddCounterToList(perfCounterProtocolFailuresNamedPipe    = ListenerPerfCounters.GetListenerPerformanceCounter(CategoryName, PerformanceCounterStrings.SMSVCHOST.ProtocolFailuresNamedPipe, string.Empty, PerformanceCounterInstanceLifetime.Global));

                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ListenerPerfCounters.ExitOrUnloadEventHandler);
                AppDomain.CurrentDomain.DomainUnload       += new EventHandler(ListenerPerfCounters.ExitOrUnloadEventHandler);
                AppDomain.CurrentDomain.ProcessExit        += new EventHandler(ListenerPerfCounters.ExitOrUnloadEventHandler);
            }
        }
Ejemplo n.º 3
0
 internal static void DecrementRegistrationsActiveTcp()
 {
     ListenerPerfCounters.DecrementCounter(ref perfCounterRegistrationsActiveTcp);
 }
Ejemplo n.º 4
0
 internal static void DecrementRegistrationsActiveNamedPipe()
 {
     ListenerPerfCounters.DecrementCounter(ref perfCounterRegistrationsActiveNamedPipe);
 }
Ejemplo n.º 5
0
 internal static void IncrementUrisUnregisteredTcp()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterUrisUnregisteredTcp);
 }
Ejemplo n.º 6
0
 internal static void IncrementConnectionsDispatchedTcp()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterConnectionsDispatchedTcp);
 }
Ejemplo n.º 7
0
 internal static void IncrementUrisUnregisteredNamedPipe()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterUrisUnregisteredNamedPipe);
 }
Ejemplo n.º 8
0
 internal static void IncrementConnectionsDispatchedNamedPipe()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterConnectionsDispatchedNamedPipe);
 }
Ejemplo n.º 9
0
 internal static void IncrementProtocolFailuresTcp()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterProtocolFailuresTcp);
 }
Ejemplo n.º 10
0
 internal static void IncrementProtocolFailuresNamedPipe()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterProtocolFailuresNamedPipe);
 }
Ejemplo n.º 11
0
 internal static void IncrementDispatchFailuresTcp()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterDispatchFailuresTcp);
 }
Ejemplo n.º 12
0
 internal static void IncrementDispatchFailuresNamedPipe()
 {
     ListenerPerfCounters.IncrementCounter(ref perfCounterDispatchFailuresNamedPipe);
 }