Browse Source

【CHG】修改导出计时

ZhaoMn 3 years ago
parent
commit
e2eb2c0af0

+ 4 - 0
railway-business/src/main/java/com/railway/business/safetool/service/impl/BaseSafetyToolServiceImpl.java

@@ -226,9 +226,13 @@ public class BaseSafetyToolServiceImpl implements IBaseSafetyToolService {
     }
     log.info(" * 开始整理二维码图片文件 * ");
     long time1 = System.currentTimeMillis();
+    int i = 0;
     for (BaseSafetyTool tool : tools){
+      long t1 = System.currentTimeMillis();
       String jpgPath = tmpPath + tool.getToolCode() + ".jpg";
       HttpUtils.download(tool.getQcodeUrl(), jpgPath);
+      long t2 = System.currentTimeMillis();
+      log.debug(" -- {}/{} ++ {}", i++, tools.size(), (t2 - t1));
     }
     String zipFile;
     try {

+ 0 - 3
railway-common/src/main/java/com/railway/common/utils/http/HttpUtils.java

@@ -134,7 +134,6 @@ public class HttpUtils {
   }
 
   public static void download(String url, String filePath) {
-    long time1 = System.currentTimeMillis();
     InputStream in = sendGetStream(url);
     if(null == in){
       return;
@@ -149,8 +148,6 @@ public class HttpUtils {
     } catch (IOException e) {
       log.error("下载出错 : {}", url);
     }
-    long time2 = System.currentTimeMillis();
-    log.debug(" ++ {}", (time2 - time1));
   }
 
   /**