提交 e396b608 编写于 作者: Z zyyang

change

上级 f2ba1f79
...@@ -2,7 +2,6 @@ package com.taosdata.jdbc.utils; ...@@ -2,7 +2,6 @@ package com.taosdata.jdbc.utils;
import javax.management.*; import javax.management.*;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
public class TaosInfo implements TaosInfoMBean { public class TaosInfo implements TaosInfoMBean {
...@@ -17,6 +16,7 @@ public class TaosInfo implements TaosInfoMBean { ...@@ -17,6 +16,7 @@ public class TaosInfo implements TaosInfoMBean {
MBeanServer server = ManagementFactory.getPlatformMBeanServer(); MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName("TaosInfoMBean:name=TaosInfo"); ObjectName name = new ObjectName("TaosInfoMBean:name=TaosInfo");
server.registerMBean(TaosInfo.getInstance(), name); server.registerMBean(TaosInfo.getInstance(), name);
} catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) { } catch (MalformedObjectNameException | InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -17,7 +17,7 @@ public class TaosInfoMonitorTest { ...@@ -17,7 +17,7 @@ public class TaosInfoMonitorTest {
List<Connection> connectionList = IntStream.range(0, 100).mapToObj(i -> { List<Connection> connectionList = IntStream.range(0, 100).mapToObj(i -> {
try { try {
TimeUnit.SECONDS.sleep(1); TimeUnit.MILLISECONDS.sleep(100);
return DriverManager.getConnection(url); return DriverManager.getConnection(url);
} catch (SQLException | InterruptedException e) { } catch (SQLException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -31,7 +31,7 @@ public class TaosInfoMonitorTest { ...@@ -31,7 +31,7 @@ public class TaosInfoMonitorTest {
while (rs.next()) { while (rs.next()) {
} }
TimeUnit.MILLISECONDS.sleep(50); TimeUnit.MILLISECONDS.sleep(100);
} catch (SQLException | InterruptedException e) { } catch (SQLException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -40,7 +40,7 @@ public class TaosInfoMonitorTest { ...@@ -40,7 +40,7 @@ public class TaosInfoMonitorTest {
connectionList.stream().forEach(conn -> { connectionList.stream().forEach(conn -> {
try { try {
conn.close(); conn.close();
TimeUnit.SECONDS.sleep(1); TimeUnit.MILLISECONDS.sleep(100);
} catch (SQLException | InterruptedException e) { } catch (SQLException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册