Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rocketmq monitor #1046

Merged
merged 6 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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