Search code examples
c#azureservicebusazureservicebus

Windows Service Bus Check Performance Counters


I want to develop a C# application. The application should check performance coutners on the Service Bus like

• The current number of messages per Topic / Queue

• The average processing time per message

• The number of messages processed per unit of time

I saw that there is a package for C# available named "Service Bus 1.0 for Windows Server" but with that you can't check performance counters. Any suggestions?


Solution

  • This sounds like a problem for the Windows Azure Management Libraries. A c# library that microsoft is releasing soon. You can get it from Nuget as prerelease at this point.

    Microsoft.WindowsAzure.Management.ServiceBus
    

    and heres some code that will get you started.

    using (var azure = new ServiceBusManagementClient(...))
    {
       var allYourServiceNamespaces = await azure.Namespaces.ListAsync();
       var topic = azure.Topics.Get(allYourServiceNamespaces.First().Name,"topicname").Topic;
    
    
    }
    

    I am not sure if you can get the processing time per message ect, but it can give you the same information you can get from the REST API.