This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
wanglihui-ip-learning-graph/ip-learning-java-test/src/main/java/cn/ac/iie/test/IpLearningApplicationTest.java
2020-06-28 18:29:39 +08:00

79 lines
2.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cn.ac.iie.test;
import cn.ac.iie.dao.BaseArangoData;
import cn.ac.iie.dao.BaseClickhouseData;
import cn.ac.iie.utils.ArangoDBConnect;
import cn.ac.iie.utils.ExecutorThreadPool;
import java.util.concurrent.CountDownLatch;
public class IpLearningApplicationTest {
public static void main(String[] args) {
long startA = System.currentTimeMillis();
// BaseArangoData.BaseVFqdnDataMap();
// BaseArangoData.BaseVIpDataMap();
// BaseArangoData.BaseEFqdnAddressIpDataMap();
// BaseArangoData.BaseEIpVisitFqdnDataMap();
// ExecutorThreadPool.shutdown();
// ExecutorThreadPool.awaitThreadTask();
long lastA = System.currentTimeMillis();
System.out.println("读取ArangoDb时间"+(lastA - startA));
// UpdateGraphsData.updateVFqdn();
// UpdateGraphsData.updateVIp();
// UpdateGraphsData.updateEFqdnAddressIp();
// UpdateGraphsData.updateEIpVisitFqdn();
long startC = System.currentTimeMillis();
CountDownLatch countDownLatch = new CountDownLatch(4);
new Thread(new Runnable() {
@Override
public void run() {
BaseClickhouseData.BaseVFqdn();
countDownLatch.countDown();
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
BaseClickhouseData.BaseVIp();
countDownLatch.countDown();
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
BaseClickhouseData.BaseEFqdnAddressIp();
countDownLatch.countDown();
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
BaseClickhouseData.BaseEIpVisitFqdn();
countDownLatch.countDown();
}
}).start();
try {
countDownLatch.await();
}catch (Exception e){
e.printStackTrace();
}
long lastC = System.currentTimeMillis();
System.out.println("更新ArangoDb时间"+(lastC - startC));
System.out.println(BaseArangoData.v_Fqdn_Map.size());
System.out.println(BaseArangoData.v_Ip_Map.size());
System.out.println(BaseArangoData.e_Fqdn_Address_Ip_Map.size());
System.out.println(BaseArangoData.e_Ip_Visit_Fqdn_Map.size());
ArangoDBConnect.clean();
}
}