org.apache.rocketmq.common.running.RunningStats Java Examples

The following examples show how to use org.apache.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 DDMQ 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.getMaxOffsetInQueue(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 DDMQ 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 #3
Source File: ScheduleMessageService.java    From rocketmq-4.3.0 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.getMaxOffsetInQueue(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-4.3.0 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-read 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.getMaxOffsetInQueue(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-read with Apache License 2.0 5 votes vote down vote up
/**
 * 获取运行时信息
 * @return ;
 */
@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 #7
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 #8
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 #9
Source File: ScheduleMessageService.java    From DDMQ 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.getMaxOffsetInQueue(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 #10
Source File: DefaultMessageStore.java    From DDMQ 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 #11
Source File: ScheduleMessageService.java    From rocketmq-all-4.1.0-incubating 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.getMaxOffsetInQueue(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 #12
Source File: DefaultMessageStore.java    From rocketmq-all-4.1.0-incubating 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 #13
Source File: ScheduleMessageService.java    From rocketmq_trans_message 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 #14
Source File: DefaultMessageStore.java    From rocketmq_trans_message 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 #15
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<Map.Entry<Integer, Long>> it = this.offsetTable.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<Integer, Long> next = it.next();
        int queueId = delayLevel2QueueId(next.getKey());
        long delayOffset = next.getValue();
        long maxOffset = this.defaultMessageStore.getMaxOffsetInQueue(TopicValidator.RMQ_SYS_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 #16
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;
}