shaohongbo 3 jaren geleden
bovenliggende
commit
7285aee3cb

+ 2 - 3
src/main/java/com/persagy/apm/diagnose/config/RedisConfig.java

@@ -12,10 +12,9 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.connection.*;
 import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
 import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
-import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
-import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration;
+
 import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.StringRedisTemplate;
+
 import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
 import org.springframework.data.redis.serializer.StringRedisSerializer;
 import org.springframework.util.StringUtils;

+ 11 - 5
src/main/java/com/persagy/apm/diagnose/service/ComputeIndicatorDataService.java

@@ -55,15 +55,18 @@ public class ComputeIndicatorDataService {
     public void computeIndicatorData() throws Exception {
         //查询项目列表
         List<ProjectDTO> projectDTOList = saasWebServiceImpl.queryProjectDTOList(null);
-        if(CollectionUtils.isEmpty(projectDTOList)){
+        if (CollectionUtils.isEmpty(projectDTOList)) {
             return;
         }
-        Map<String,ProjectIndicatorCompute> projectIdAndProjectCompute =  projectIndicatorComputeService.getProjectIdAndProjectCompute();
+        Map<String, ProjectIndicatorCompute> projectIdAndProjectCompute = projectIndicatorComputeService.getProjectIdAndProjectCompute();
 
         List<Future<String>> futureList = new ArrayList<>();
         CountDownLatch latch = new CountDownLatch(projectDTOList.size());
         for (ProjectDTO projectDTO : projectDTOList) {
-            futureList.add(monitorIndicatorRecordService.computeIndicatorData(projectDTO,projectIdAndProjectCompute.get(projectDTO.getProjectId()),latch));
+            if (!projectDTO.getProjectId().equals("Pj1101060001")) {
+                continue;
+            }
+            futureList.add(monitorIndicatorRecordService.computeIndicatorData(projectDTO, projectIdAndProjectCompute.get(projectDTO.getProjectId()), latch));
         }
         //等待所有任务执行完
         latch.await();
@@ -79,13 +82,16 @@ public class ComputeIndicatorDataService {
     public void sendIndicatorData() throws Exception {
         //查询项目列表
         List<ProjectDTO> projectDTOList = saasWebServiceImpl.queryProjectDTOList(null);
-        if(CollectionUtils.isEmpty(projectDTOList)){
+        if (CollectionUtils.isEmpty(projectDTOList)) {
             return;
         }
         List<Future<String>> futureList = new ArrayList<>();
         CountDownLatch latch = new CountDownLatch(projectDTOList.size());
         for (ProjectDTO projectDTO : projectDTOList) {
-            futureList.add(monitorIndicatorRecordService.sendIndicatorData(projectDTO,latch));
+            if (!projectDTO.getProjectId().equals("Pj1101051029")||!projectDTO.getProjectId().equals("Pj1101051029")) {
+                continue;
+            }
+            futureList.add(monitorIndicatorRecordService.sendIndicatorData(projectDTO, latch));
         }
         //等待所有任务执行完
         latch.await();

+ 1 - 0
src/main/java/com/persagy/apm/diagnose/service/SaasWebServiceImpl.java

@@ -43,6 +43,7 @@ public class SaasWebServiceImpl {
         puser.put("userId", USERID);
         puser.put("loginDevice", LOGINDEVICE);
         param.put("puser", puser);
+        param.put("groupCode","WD");
         if (!CollectionUtils.isEmpty(projectIdList)) {
             param.put("projectIds", projectIdList);
         }

+ 1 - 1
src/main/java/com/persagy/apm/diagnose/service/schedule/ComputeIndicatorData.java

@@ -21,7 +21,7 @@ public class ComputeIndicatorData {
     @Autowired
     private ComputeIndicatorDataService computeIndicatorDataService;
 
-    @Scheduled(cron="${eyd.compute.indicator.data.cron:0 0 0 * * ?}")
+    @Scheduled(cron="${eyd.compute.indicator.data.cron:*/5 * * * * ?}")
     public void computeIndicatorData() throws Exception {
     	if (!enable) {
     	    //指标计算未开启

+ 1 - 1
src/main/java/com/persagy/apm/diagnose/service/schedule/SendIndicatorData.java

@@ -21,7 +21,7 @@ public class SendIndicatorData {
     @Autowired
     private ComputeIndicatorDataService computeIndicatorDataService;
 
-    @Scheduled(cron="${eyd.send.indicator.data.cron:0 0 0 * * ?}")
+    @Scheduled(cron="${eyd.send.indicator.data.cron:*/5 * * * * ?}")
     public void computeIndicatorData() throws Exception {
     	if (!enable) {
     	    //指标计算未开启