enqueueCount与dequeueCount的含义

本文介绍了消息队列中几个核心指标的意义及作用:InFlightCount代表已分发待确认的消息数;AverageEnqueueTime为消息平均驻留时间;EnqueueCount记录总入队消息数;DequeueCount记录总成功出队消息数;DispatchCount记录总分发消息数。通过这些指标可以监控消息队列的工作状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

InFlightCount: The number of messages that have been dispatched and are currently awaiting acknowledgment from the consumer. So as this number decreases, the DequeueCount increases.

AverageEnqueueTime: On average, the amount of time (ms) that messages remained enqueued. Or average time it is taking the consumers to successfully process messages.

EnqueueCount: The number of messages that have been written to the queue over the lifetime of the queue.

DequeueCount: The number of messages that have been successfully (i.e., they’ve been acknowledged from the consumer) read off the queue over the lifetime of the queue.

DispatchCount: The number of messages that have been dispatched (sent) to the consumer over the lifetime of the queue. Note that dispatched messages may not have all been acknowledged.

showQueueData() { let myChart = this.$echarts.init(document.getElementById("myChart")); myChart.clear(); let seriesData = []; // 定义一个空数组用于存储所有队列的 series 数据 let queueAttributes = this.request.queueAttribute; queueAttributes.forEach(attribute => { let dataMap = {}; this.responseData.forEach(item => { if (!dataMap[item.nameWithIp]) { dataMap[item.nameWithIp] = { name: item.nameWithIp, type: 'line', data: [], }; seriesData.push(dataMap[item.nameWithIp]); // 将当前队列的 series 数据添加到 seriesData 数组中 } dataMap[item.nameWithIp].data.push({ value: [item.monitorDate, item[attribute]], attribute: attribute, name: item.name, server: item.server, monitorDate: item.monitorDate, queueSize: item.queueSize, enqueueCount: item.enqueueCount, dequeueCount: item.dequeueCount, enqueueCountDiff: item.enqueueCountDiff, dequeueCountDiff: item.dequeueCountDiff, consumerCount: item.consumerCount, producerCount: item.producerCount, symbol: 'circle', symbolSize: 4, }); }); }); let myChartOptions = { tooltip: { trigger: 'item', axisPointer: { type: 'line', lineStyle: { color: '#999' }, }, formatter: params => { let data = params.data; return 队列名称:${data.name}<br/> 队列ip:${data.server}<br/> 监控属性:${data.attribute}<br/> 时间:${data.monitorDate}<br/> 积压数:${data.queueSize}<br/> 总生产数:${data.enqueueCount}<br/> 生产数:${data.enqueueCountDiff}<br/> 总消费数:${data.dequeueCount}<br/> 消费数:${data.dequeueCountDiff}<br/> 生产者数:${data.consumerCount}<br/> 消费者数:${data.producerCount}; }, }, xAxis: { type: 'time', }, yAxis: { type: 'value', }, series: seriesData, // 将所有队列的 series 数据作为一个数组设置给 myChartOptions }; myChart.setOption(myChartOptions);} 在这段代码中 不同的attribute生成的折线颜色是一样的 可以设置成颜色不同吗
06-09
我按你说的循环执行了 代码改成了 let myChart = this.$echarts.init(document.getElementById("myChart")); myChart.clear(); let queueAttributes = this.request.queueAttribute; queueAttributes.forEach(attribute => { let dataMap = {}; this.responseData.forEach(item => { if (!dataMap[item.nameWithIp]) { dataMap[item.nameWithIp] = {name: item.nameWithIp, type: 'line', data: [],}; } dataMap[item.nameWithIp].data.push({ value: [item.monitorDate, item[attribute]], attribute: attribute, name: item.name, server: item.server, monitorDate: item.monitorDate, queueSize: item.queueSize, enqueueCount: item.enqueueCount, dequeueCount: item.dequeueCount, enqueueCountDiff: item.enqueueCountDiff, dequeueCountDiff: item.dequeueCountDiff, consumerCount: item.consumerCount, producerCount: item.producerCount, symbol: 'circle', symbolSize: 4, }); }); let seriesData = Object.values(dataMap); let myChartOptions = { tooltip: { trigger: 'item', axisPointer: {type: 'line', lineStyle: {color: '#999'}}, formatter: params => { let data = params.data; return 队列名称: ${data.name}<br/> 队列ip: ${data.server}<br/> 监控属性: ${data.attribute}<br/> 时间: ${data.monitorDate}<br/> 积压数: ${data.queueSize}<br/> 总生产数: ${data.enqueueCount}<br/> 生产数: ${data.enqueueCountDiff}<br/> 总消费数: ${data.dequeueCount}<br/> 消费数: ${data.dequeueCountDiff}<br/> 生产者数: ${data.consumerCount}<br/> 消费者数: ${data.producerCount}; }, }, xAxis: {type: 'time',}, yAxis: {type: 'value',}, series: seriesData, }; myChart.setOption(myChartOptions) }); 但是做的线段只有this.request.queueAttribut最后一个元素生成的数据 这是为什么
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值