private void collectTopicOffsetMetric()

in src/main/java/org/apache/rocketmq/exporter/collector/RMQMetricsCollector.java [362:387]


    private void collectTopicOffsetMetric(List<MetricFamilySamples> mfs) {
        GaugeMetricFamily topicOffsetF = new GaugeMetricFamily("rocketmq_producer_offset", "TopicOffset", TOPIC_OFFSET_LABEL_NAMES);
        for (Map.Entry<ProducerMetric, Double> entry : topicOffset.asMap().entrySet()) {
            loadTopicOffsetMetric(topicOffsetF, entry);
        }
        mfs.add(topicOffsetF);

        GaugeMetricFamily topicRetryOffsetF = new GaugeMetricFamily("rocketmq_topic_retry_offset", "TopicRetryOffset", TOPIC_OFFSET_LABEL_NAMES);
        for (Map.Entry<ProducerMetric, Double> entry : topicRetryOffset.asMap().entrySet()) {
            loadTopicOffsetMetric(topicRetryOffsetF, entry);
        }
        mfs.add(topicRetryOffsetF);

        GaugeMetricFamily topicDLQOffsetF = new GaugeMetricFamily("rocketmq_topic_dlq_offset", "TopicRetryOffset", DLQ_TOPIC_OFFSET_LABEL_NAMES);
        for (Map.Entry<DLQTopicOffsetMetric, Double> entry : topicDLQOffset.asMap().entrySet()) {
            topicDLQOffsetF.addMetric(
                Arrays.asList(
                    entry.getKey().getClusterName(),
                    entry.getKey().getBrokerName(),
                    entry.getKey().getGroup()
                ),
                entry.getValue());
        }
        mfs.add(topicDLQOffsetF);

    }