Windows服务总线检查性能计数器

时间:2014-02-21 07:39:12

标签: c# azure servicebus azureservicebus

我想开发一个C#应用程序。应用程序应检查服务总线上的性能coutners,如

•每个主题/队列的当前消息数

•每封邮件的平均处理时间

•每单位时间处理的邮件数

我看到有一个C#包名为“Service Bus 1.0 for Windows Server”,但是你无法检查性能计数器。有什么建议吗?

1 个答案:

答案 0 :(得分:1)

这听起来像Windows Azure管理库的问题。一个微软即将发布的c#库。你可以从Nuget那里得到它作为预发布。

Microsoft.WindowsAzure.Management.ServiceBus

并且有一些代码可以帮助你入门。

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


}

我不确定您是否可以获得每条消息的处理时间等,但它可以为您提供从REST API获得的相同信息。