新增超时记录

This commit is contained in:
沈健
2021-11-22 21:47:44 +08:00
parent 853e52038d
commit 5e7a880091
+9 -3
View File
@@ -4,6 +4,7 @@ import com.alibaba.excel.util.StringUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.util.StopWatch;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
@@ -20,7 +21,7 @@ import java.util.concurrent.atomic.AtomicLong;
public class BatchTest {
static final String IP = "192.168.0.19:39080";
static final String IP = "192.168.0.216:39080";
final String sourceFilePath = "D:\\goojia\\批量测试10万.xlsx";
final String aimFilePath = "D:\\goojia\\批量测试10万结果.xlsx";
final int column = 2;
@@ -53,6 +54,8 @@ public class BatchTest {
}
});
StopWatch stopWatch = new StopWatch();
stopWatch.start("总标准化耗时");
try {
CountDownLatch latch = new CountDownLatch(set.size());
RestTemplate restTemplate = new RestTemplate();
@@ -109,14 +112,17 @@ public class BatchTest {
count.incrementAndGet();
synchronized (this) {
if (count.longValue() % 1000 == 0) {
System.out.println("已标准化处理" + count.longValue() + "条地址");
stopWatch.stop();
System.out.println("已标准化处理" + count.longValue() + "条地址, 耗时:" + stopWatch.getTotalTimeMillis());
stopWatch.start();
}
}
}
});
}
latch.await();
System.out.println("已完成该批次地址标准化");
stopWatch.stop();
System.out.println("已完成该批次地址标准化,耗时" + stopWatch.getTotalTimeMillis());
for (List<String> data : dataList) {
String address = "";