Skip to content

Commit

Permalink
support monitoring apache rocketmq metrics (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceilzcx authored Jun 28, 2023
1 parent cb02251 commit 420f74a
Show file tree
Hide file tree
Showing 8 changed files with 716 additions and 0 deletions.
7 changes: 7 additions & 0 deletions collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@
<artifactId>snmp4j</artifactId>
<version>3.6.7</version>
</dependency>

<!-- rocketmq -->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-tools</artifactId>
<version>4.9.4</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
package org.dromara.hertzbeat.collector.collect.mq;

import lombok.Data;

import java.util.List;
import java.util.Map;

/**
* rocketmq采集数据实体类
*
* @author ceilzcx
* @since 5/6/2023
*/
@Data
public class RocketmqCollectData {

/**
* cluster broker info
*/
private List<ClusterBrokerData> clusterBrokerDataList;

/**
* consumer info
*/
private List<ConsumerInfo> consumerInfoList;

/**
* topic info
* Map[key: TopicName, value: Topic Queue info List]
*/
private List<Map<String, List<TopicQueueInfo>>> topicInfoList;

@Data
public static class ClusterBrokerData {

/**
* broker id
*/
private Long brokerId;

/**
* broker address
*/
private String address;

/**
* mq version
*/
private String version;

/**
* producer send message tps
*/
private double producerMessageTps;

/**
* consumer receive message tps
*/
private double consumerMessageTps;

/**
* yesterday producer send message count
*/
private long yesterdayProduceCount;

/**
* today producer send message count
*/
private long todayProduceCount;

/**
* yesterday consumer receive message count
*/
private long yesterdayConsumeCount;

/**
* today consumer receive message count
*/
private long todayConsumeCount;
}

@Data
public static class ConsumerInfo {

/**
* consumer group
*/
private String consumerGroup;

/**
* client num
*/
private int clientQuantity;

/**
* message model
*/
private String messageModel;

/**
* consume type
*/
private String consumeType;

/**
* consume tps
*/
private double consumeTps;

/**
* message delay
*/
private long diffTotal;
}

@Data
public static class TopicQueueInfo {

/**
* broker name
*/
private String brokerName;

/**
* queue id
*/
private int queueId;

/**
* message queue min offset
*/
private long minOffset;

/**
* message queue max offset
*/
private long maxOffset;

/**
* last update time(ms)
*/
private long lastUpdateTimestamp;
}
}
Loading

0 comments on commit 420f74a

Please sign in to comment.