com.alibaba.rocketmq.common.running.RunningStats Java Examples

The following examples show how to use com.alibaba.rocketmq.common.running.RunningStats. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ScheduleMessageService.java    From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 5 votes vote down vote up
public void buildRunningStats(HashMap<String, String> stats) {
    Iterator<Entry<Integer, Long>> it = this.offsetTable.entrySet().iterator();
    while (it.hasNext()) {
        Entry<Integer, Long> next = it.next();
        int queueId = delayLevel2QueueId(next.getKey());
        long delayOffset = next.getValue();
        long maxOffset = this.defaultMessageStore.getMaxOffsetInQuque(SCHEDULE_TOPIC, queueId);
        String value = String.format("%d,%d", delayOffset, maxOffset);
        String key = String.format("%s_%d", RunningStats.scheduleMessageOffset.name(), next.getKey());
        stats.put(key, value);
    }
}
 
Example #2
Source File: DefaultMessageStore.java    From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public HashMap<String, String> getRuntimeInfo() {
    HashMap<String, String> result = this.storeStatsService.getRuntimeInfo();
    {
        String storePathPhysic = DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog();
        //获取commitlog文件夹占用磁盘资源百分百
        double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);
        result.put(RunningStats.commitLogDiskRatio.name(), String.valueOf(physicRatio));

    }

    {

        String storePathLogics = StorePathConfigHelper.getStorePathConsumeQueue(this.messageStoreConfig.getStorePathRootDir());
        double logicsRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathLogics);
        //consumeQueue文件夹占用磁盘资源百分比
        result.put(RunningStats.consumeQueueDiskRatio.name(), String.valueOf(logicsRatio));
    }

    {   //获取存在于延时队列offset中还未到时间的消息的offset,以及把到时间到消息移到commitlog和consumeQueue队列后的offset获取出来
        if (this.scheduleMessageService != null) {
            this.scheduleMessageService.buildRunningStats(result);
        }
    }

    //commilog目录文件的最小offset和最大offset
    result.put(RunningStats.commitLogMinOffset.name(), String.valueOf(DefaultMessageStore.this.getMinPhyOffset()));
    result.put(RunningStats.commitLogMaxOffset.name(), String.valueOf(DefaultMessageStore.this.getMaxPhyOffset()));

    return result;
}
 
Example #3
Source File: ScheduleMessageService.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
public void buildRunningStats(HashMap<String, String> stats) {
    Iterator<Entry<Integer, Long>> it = this.offsetTable.entrySet().iterator();
    while (it.hasNext()) {
        Entry<Integer, Long> next = it.next();
        int queueId = delayLevel2QueueId(next.getKey());
        long delayOffset = next.getValue();
        long maxOffset = this.defaultMessageStore.getMaxOffsetInQuque(SCHEDULE_TOPIC, queueId);
        String value = String.format("%d,%d", delayOffset, maxOffset);
        String key = String.format("%s_%d", RunningStats.scheduleMessageOffset.name(), next.getKey());
        stats.put(key, value);
    }
}
 
Example #4
Source File: DefaultMessageStore.java    From rocketmq with Apache License 2.0 5 votes vote down vote up
@Override
public HashMap<String, String> getRuntimeInfo() {
    HashMap<String, String> result = this.storeStatsService.getRuntimeInfo();

    {
        String storePathPhysic = DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog();
        double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);
        result.put(RunningStats.commitLogDiskRatio.name(), String.valueOf(physicRatio));

    }


    {

        String storePathLogics = StorePathConfigHelper.getStorePathConsumeQueue(this.messageStoreConfig.getStorePathRootDir());
        double logicsRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathLogics);
        result.put(RunningStats.consumeQueueDiskRatio.name(), String.valueOf(logicsRatio));
    }


    {
        if (this.scheduleMessageService != null) {
            this.scheduleMessageService.buildRunningStats(result);
        }
    }

    result.put(RunningStats.commitLogMinOffset.name(), String.valueOf(DefaultMessageStore.this.getMinPhyOffset()));
    result.put(RunningStats.commitLogMaxOffset.name(), String.valueOf(DefaultMessageStore.this.getMaxPhyOffset()));

    return result;
}
 
Example #5
Source File: ScheduleMessageService.java    From RocketMQ-Master-analyze with Apache License 2.0 5 votes vote down vote up
public void buildRunningStats(HashMap<String, String> stats) {
    Iterator<Entry<Integer, Long>> it = this.offsetTable.entrySet().iterator();
    while (it.hasNext()) {
        Entry<Integer, Long> next = it.next();
        int queueId = delayLevel2QueueId(next.getKey());
        long delayOffset = next.getValue();
        long maxOffset = this.defaultMessageStore.getMaxOffsetInQuque(SCHEDULE_TOPIC, queueId);
        String value = String.format("%d,%d", delayOffset, maxOffset);
        String key = String.format("%s_%d", RunningStats.scheduleMessageOffset.name(), next.getKey());
        stats.put(key, value);
    }
}
 
Example #6
Source File: DefaultMessageStore.java    From RocketMQ-Master-analyze with Apache License 2.0 5 votes vote down vote up
@Override
public HashMap<String, String> getRuntimeInfo() {
    HashMap<String, String> result = this.storeStatsService.getRuntimeInfo();
    // 检测物理文件磁盘空间
    {
        String storePathPhysic = DefaultMessageStore.this.getMessageStoreConfig().getStorePathCommitLog();
        double physicRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathPhysic);
        result.put(RunningStats.commitLogDiskRatio.name(), String.valueOf(physicRatio));

    }

    // 检测逻辑文件磁盘空间
    {

        String storePathLogics = StorePathConfigHelper
            .getStorePathConsumeQueue(this.messageStoreConfig.getStorePathRootDir());
        double logicsRatio = UtilAll.getDiskPartitionSpaceUsedPercent(storePathLogics);
        result.put(RunningStats.consumeQueueDiskRatio.name(), String.valueOf(logicsRatio));
    }

    // 延时进度
    {
        if (this.scheduleMessageService != null) {
            this.scheduleMessageService.buildRunningStats(result);
        }
    }

    result.put(RunningStats.commitLogMinOffset.name(),
        String.valueOf(DefaultMessageStore.this.getMinPhyOffset()));
    result.put(RunningStats.commitLogMaxOffset.name(),
        String.valueOf(DefaultMessageStore.this.getMaxPhyOffset()));

    return result;
}