Browse Source

评分接口耗时测试统计

songxinlu 3 years atrás
parent
commit
2d98603d86

+ 12 - 1
security-center/src/main/java/com/lantone/security/facade/analyze/compute/BehospitalInfoManagementFacade_New.java

@@ -129,6 +129,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
+import org.springframework.util.StopWatch;
 
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -259,9 +260,12 @@ public class BehospitalInfoManagementFacade_New {
             hospitalId = SysUserUtils.getCurrentHospitalId();
         }
         analyzeVO.setHospitalId(hospitalId);
-
+        StopWatch sw = new StopWatch("评分耗时");
+        sw.start("处理公共数据");
         // 处理公共数据
         QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
+        sw.stop();
+        sw.start("check");
         queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
         //已核查抛出以评分
         List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
@@ -272,8 +276,13 @@ public class BehospitalInfoManagementFacade_New {
         if (medCheckInfos.size() >= 1 && status.contains(CheckStatusEnum.Enable.getKey()) && analyzeVO.getCheckFlag()) {
             Asserts.fail("该病例已经核查无需评分!");
         }
+        sw.stop();
+        sw.start("质控");
         //  调用质控接口
         Response<OutputInfo> response = qcServiceClient.extract(queryVo);
+        sw.stop();
+
+        sw.start("评分");
         if (response == null || response.getData() == null) {
             if (null == response) {
                 Asserts.fail("远程质控接口没有返回数据!【" + analyzeVO.getBehospitalCode() + "】");
@@ -303,6 +312,8 @@ public class BehospitalInfoManagementFacade_New {
         analyzeDTO.setScoreRes(algorithmDTO.getScore());
         analyzeDTO.setLevel(algorithmDTO.getLevel());
         analyzeDTO.setGradeTime(date);
+        sw.stop();
+        System.out.println(sw.prettyPrint());
         return analyzeDTO;
     }