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

Change the SendBackNums metric from TPS to a one-minute value #52

Merged
merged 2 commits into from
Jul 22, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class RMQMetricsCollector extends Collector {
//consumed message size(byte) for consumer-topic
private ConcurrentHashMap<ConsumerMetric, Double> groupGetSize = new ConcurrentHashMap<>();
//re-consumed message count for consumer-topic
private ConcurrentHashMap<ConsumerMetric, Double> sendBackNums = new ConcurrentHashMap<>();
private ConcurrentHashMap<ConsumerMetric, Long> sendBackNums = new ConcurrentHashMap<>();
// group latency time
private ConcurrentHashMap<ConsumerMetric, Long> groupLatencyByTime = new ConcurrentHashMap<>();

Expand Down Expand Up @@ -500,7 +500,7 @@ private void collectGroupNums(List<MetricFamilySamples> mfs) {
mfs.add(groupGetSizeGauge);

GaugeMetricFamily sendBackNumsGauge = new GaugeMetricFamily("rocketmq_send_back_nums", "SendBackNums", GROUP_NUMS_LABEL_NAMES);
for (Map.Entry<ConsumerMetric, Double> entry : sendBackNums.entrySet()) {
for (Map.Entry<ConsumerMetric, Long> entry : sendBackNums.entrySet()) {
loadGroupNumsMetric(sendBackNumsGauge, entry);
}
mfs.add(sendBackNumsGauge);
Expand Down Expand Up @@ -597,7 +597,7 @@ public void addGroupGetSizeMetric(String clusterName, String brokerName, String
groupGetSize.put(new ConsumerMetric(clusterName, brokerName, topic, group), value);
}

public void addSendBackNumsMetric(String clusterName, String brokerName, String topic, String group, double value) {
public void addSendBackNumsMetric(String clusterName, String brokerName, String topic, String group, long value) {
sendBackNums.put(new ConsumerMetric(clusterName, brokerName, topic, group), value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public void collectBrokerStatsTopic() {
bd.getBrokerName(),
topic,
group,
Utils.getFixedDouble(bsd.getStatsMinute().getTps()));
bsd.getStatsMinute().getSum());
} catch (MQClientException ex) {
if (ex.getResponseCode() == ResponseCode.SYSTEM_ERROR) {
log.error(String.format("SNDBCK_PUT_NUMS-error, topic=%s, group=%s, master broker=%s, %s", topic, group, masterAddr, ex.getErrorMessage()));
Expand Down