Browse Source

请求时长

yumeng 5 years ago
parent
commit
1138716a5c

+ 9 - 1
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/MaterialReportServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.ctop.bytedance.mapper.MaterialReportMapper;
 import cn.com.ctop.bytedance.service.IMaterialReportService;
 import cn.com.ctop.bytedance.service.IMaterialReportService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -14,6 +15,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+@Slf4j
 @Service
 @Service
 public class MaterialReportServiceImpl implements IMaterialReportService {
 public class MaterialReportServiceImpl implements IMaterialReportService {
     @Autowired
     @Autowired
@@ -35,6 +37,9 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
     @Override
     @Override
     public List<JSONObject> getKuaiShouMaterialMarket(JSONObject json) {
     public List<JSONObject> getKuaiShouMaterialMarket(JSONObject json) {
 
 
+
+        long startTime = System.currentTimeMillis();
+
         List<JSONObject> marketJsonList = new ArrayList<>();
         List<JSONObject> marketJsonList = new ArrayList<>();
         try {
         try {
             if (Check.isNull(json)) {
             if (Check.isNull(json)) {
@@ -112,6 +117,8 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
+
+        log.info("素材数据请求所用时长------------->: {} ms", System.currentTimeMillis() - startTime);
         return marketJsonList;
         return marketJsonList;
     }
     }
 
 
@@ -124,6 +131,7 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
     @Override
     @Override
     public JSONObject getKuaiShouChainRatio(JSONObject json) {
     public JSONObject getKuaiShouChainRatio(JSONObject json) {
         JSONObject returnJson = new JSONObject();
         JSONObject returnJson = new JSONObject();
+        long startTime = System.currentTimeMillis();
         try {
         try {
             if (Check.isNull(json)) {
             if (Check.isNull(json)) {
                 return null;
                 return null;
@@ -412,7 +420,7 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
                 returnJson.put("chainRatio", chainRatioJson);
                 returnJson.put("chainRatio", chainRatioJson);
             }
             }
 
 
-
+            log.info("素材数据获取环比请求所用时长------------->: {} ms", System.currentTimeMillis() - startTime);
             return returnJson;
             return returnJson;
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();