diff --git a/src/Microsoft.AspNet.SignalR.Core/Infrastructure/NoOpPerformanceCounter.cs b/src/Microsoft.AspNet.SignalR.Core/Infrastructure/NoOpPerformanceCounter.cs index ab3daade7..cf45a92fa 100644 --- a/src/Microsoft.AspNet.SignalR.Core/Infrastructure/NoOpPerformanceCounter.cs +++ b/src/Microsoft.AspNet.SignalR.Core/Infrastructure/NoOpPerformanceCounter.cs @@ -4,7 +4,7 @@ namespace Microsoft.AspNet.SignalR.Infrastructure { - internal class NoOpPerformanceCounter : IPerformanceCounter + public class NoOpPerformanceCounter : IPerformanceCounter { public string CounterName { diff --git a/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj b/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj index eeb3876e2..1e6091565 100644 --- a/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj +++ b/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj @@ -55,6 +55,7 @@ + @@ -82,4 +83,4 @@ --> - + \ No newline at end of file diff --git a/src/NzbDrone.SignalR/SignalrDependencyResolver.cs b/src/NzbDrone.SignalR/SignalrDependencyResolver.cs index 8d001d25f..f44f756a9 100644 --- a/src/NzbDrone.SignalR/SignalrDependencyResolver.cs +++ b/src/NzbDrone.SignalR/SignalrDependencyResolver.cs @@ -1,5 +1,6 @@ using System; using Microsoft.AspNet.SignalR; +using Microsoft.AspNet.SignalR.Infrastructure; using NzbDrone.Common.Composition; namespace NzbDrone.SignalR @@ -16,6 +17,8 @@ public static void Register(IContainer container) private SignalrDependencyResolver(IContainer container) { _container = container; + var performanceCounterManager = new SonarrPerformanceCounterManager(); + Register(typeof(IPerformanceCounterManager), () => performanceCounterManager); } public override object GetService(Type serviceType) diff --git a/src/NzbDrone.SignalR/SonarrPerformanceCounterManager.cs b/src/NzbDrone.SignalR/SonarrPerformanceCounterManager.cs new file mode 100644 index 000000000..fd1a9e4e3 --- /dev/null +++ b/src/NzbDrone.SignalR/SonarrPerformanceCounterManager.cs @@ -0,0 +1,54 @@ +using System.Threading; +using Microsoft.AspNet.SignalR.Infrastructure; + +namespace NzbDrone.SignalR +{ + public class SonarrPerformanceCounterManager : IPerformanceCounterManager + { + private readonly IPerformanceCounter _counter = new NoOpPerformanceCounter(); + + public void Initialize(string instanceName, CancellationToken hostShutdownToken) + { + + } + + public IPerformanceCounter LoadCounter(string categoryName, string counterName, string instanceName, bool isReadOnly) + { + return _counter; + } + + public IPerformanceCounter ConnectionsConnected => _counter; + public IPerformanceCounter ConnectionsReconnected => _counter; + public IPerformanceCounter ConnectionsDisconnected => _counter; + public IPerformanceCounter ConnectionsCurrent => _counter; + public IPerformanceCounter ConnectionMessagesReceivedTotal => _counter; + public IPerformanceCounter ConnectionMessagesSentTotal => _counter; + public IPerformanceCounter ConnectionMessagesReceivedPerSec => _counter; + public IPerformanceCounter ConnectionMessagesSentPerSec => _counter; + public IPerformanceCounter MessageBusMessagesReceivedTotal => _counter; + public IPerformanceCounter MessageBusMessagesReceivedPerSec => _counter; + public IPerformanceCounter ScaleoutMessageBusMessagesReceivedPerSec => _counter; + public IPerformanceCounter MessageBusMessagesPublishedTotal => _counter; + public IPerformanceCounter MessageBusMessagesPublishedPerSec => _counter; + public IPerformanceCounter MessageBusSubscribersCurrent => _counter; + public IPerformanceCounter MessageBusSubscribersTotal => _counter; + public IPerformanceCounter MessageBusSubscribersPerSec => _counter; + public IPerformanceCounter MessageBusAllocatedWorkers => _counter; + public IPerformanceCounter MessageBusBusyWorkers => _counter; + public IPerformanceCounter MessageBusTopicsCurrent => _counter; + public IPerformanceCounter ErrorsAllTotal => _counter; + public IPerformanceCounter ErrorsAllPerSec => _counter; + public IPerformanceCounter ErrorsHubResolutionTotal => _counter; + public IPerformanceCounter ErrorsHubResolutionPerSec => _counter; + public IPerformanceCounter ErrorsHubInvocationTotal => _counter; + public IPerformanceCounter ErrorsHubInvocationPerSec => _counter; + public IPerformanceCounter ErrorsTransportTotal => _counter; + public IPerformanceCounter ErrorsTransportPerSec => _counter; + public IPerformanceCounter ScaleoutStreamCountTotal => _counter; + public IPerformanceCounter ScaleoutStreamCountOpen => _counter; + public IPerformanceCounter ScaleoutStreamCountBuffering => _counter; + public IPerformanceCounter ScaleoutErrorsTotal => _counter; + public IPerformanceCounter ScaleoutErrorsPerSec => _counter; + public IPerformanceCounter ScaleoutSendQueueLength => _counter; + } +} \ No newline at end of file