如何在实例中获取消息计数。 [英] How to get the message count in the instances.

查看:68
本文介绍了如何在实例中获取消息计数。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,

任何人都可以帮我构建一个返回 端口名称的查询,状态,instance_count和消息计数

Can anyone help me to build a query which returns the Port name, State, instance_count and Message count

有些端口的订单delivery = true,instance_count不应该等于Message count。

There are some ports with order delivery = true, for which the instance_count should not be equal to Message count.

如果一个实例有4条消息,那么instance_count = 1,message_count = 4。

if one instance has 4 messages then instance_count = 1, and message_count = 4.

请帮助解决这个问题。

提前致谢。

推荐答案

此查询(我假设你想要的)查询跟踪数据库?):

This query (I assume you want to query the Tracking database?):

选择po.strPortName作为'Port',

(从dbo.dta_MessageInOutEvents中选择count(*)我在哪里。 nPortId = po.nPortId)as'Message Count',

(select count(distinct uidServiceInstanceId)

 来自
dbo.dta_MessageInOutEvents me  ;

,其中me.nPortId = po.nPortId)为'实例计数'从
获得
dbo.dta_PortName po

select po.strPortName as 'Port',
(select count(*) from dbo.dta_MessageInOutEvents me where me.nPortId = po.nPortId) as 'Message Count',
(select count(distinct uidServiceInstanceId)
 from
dbo.dta_MessageInOutEvents me 
where me.nPortId = po.nPortId) as 'Instance Count'
from
dbo.dta_PortName po

将显示通过各种端口执行的消息数和实例数。

Will show how many messages and how many instances has executed through the various Ports.

订购交货是正常的发送端口将在一段时间内使用相同的实例(因此许多Receive(status = 0)和Send(status = 1)事件都通过同一个实例传递)。

It is normal that an Ordered Delivery Send Port will use the same instance for periods of time (so that many both Receive (status=0) and Send (status=1) events are passed through the same instance).

如果您终止在Group Hub中找到的正在运行的Service实例,则instance只会自行更新。

The instance will only renew itself if you terminate the running Service instance found in the Group Hub.

Morten la Cour

Morten la Cour


这篇关于如何在实例中获取消息计数。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆