• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / rocketmq-dashboard / 200

pending completion
200

Pull #130

travis-ci-com

web-flow
Merge e87e98135 into 86bdb0636
Pull Request #130: Bump snakeyaml from 1.30 to 1.32

2374 of 2869 relevant lines covered (82.75%)

1.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/apache/rocketmq/dashboard/task/MonitorTask.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
package org.apache.rocketmq.dashboard.task;
18

19
import java.util.Map;
20
import javax.annotation.Resource;
21
import org.apache.rocketmq.dashboard.model.ConsumerMonitorConfig;
22
import org.apache.rocketmq.dashboard.model.GroupConsumeInfo;
23
import org.apache.rocketmq.dashboard.service.ConsumerService;
24
import org.apache.rocketmq.dashboard.service.MonitorService;
25
import org.apache.rocketmq.dashboard.util.JsonUtil;
26
import org.slf4j.Logger;
27
import org.slf4j.LoggerFactory;
28
import org.springframework.stereotype.Component;
29

30
@Component
31
public class MonitorTask {
×
32
    private Logger logger = LoggerFactory.getLogger(MonitorTask.class);
×
33

34
    @Resource
35
    private MonitorService monitorService;
36

37
    @Resource
38
    private ConsumerService consumerService;
39

40
//    @Scheduled(cron = "* * * * * ?")
41
    public void scanProblemConsumeGroup() {
42
        for (Map.Entry<String, ConsumerMonitorConfig> configEntry : monitorService.queryConsumerMonitorConfig().entrySet()) {
×
43
            GroupConsumeInfo consumeInfo = consumerService.queryGroup(configEntry.getKey());
×
44
            if (consumeInfo.getCount() < configEntry.getValue().getMinCount() || consumeInfo.getDiffTotal() > configEntry.getValue().getMaxDiffTotal()) {
×
45
                logger.info("op=look consumeInfo {}", JsonUtil.obj2String(consumeInfo)); // notify the alert system
×
46
            }
47
        }
×
48
    }
×
49

50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc