jmeter测试类
This commit is contained in:
parent
7e4bc7f87b
commit
6df9d978d5
@ -62,7 +62,7 @@ public class Test4Jemter extends AbstractJavaSamplerClient {
|
||||
arguments.addArgument("ip", "172.1.41.139");
|
||||
arguments.addArgument("ip2", "172.1.41.96");
|
||||
arguments.addArgument("port", "8889");
|
||||
arguments.addArgument("timeout", "2000");
|
||||
arguments.addArgument("timeout", "3000");
|
||||
arguments.addArgument("logSwitch", "1");
|
||||
// arguments.addArgument("ip2", "172.16.17.161");
|
||||
arguments.addArgument("dataLength", "1024");
|
||||
@ -281,6 +281,16 @@ public class Test4Jemter extends AbstractJavaSamplerClient {
|
||||
case 20:
|
||||
boolean delFlag = api.get().deleteCert(SM2dn);
|
||||
System.out.println("删除证书成功:"+ delFlag);
|
||||
break;
|
||||
case 21:
|
||||
SydApi4j.SYD_Set_Parameter_HA(ip, ip2, port, timeout);
|
||||
break;
|
||||
case 22:
|
||||
api.get().connect(ip, port, "", timeout);
|
||||
break;
|
||||
case 23:
|
||||
api.get().disconnect();
|
||||
break;
|
||||
default:
|
||||
sr.setResponseCodeOK();
|
||||
sr.setResponseData("请选择测试组", StandardCharsets.UTF_8.displayName());
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package racal.sunyard.main;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.StopWatch;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.google.gson.Gson;
|
||||
@ -2393,7 +2394,7 @@ public class SydApi4j implements SydApi {
|
||||
if (!usingBackup.get()) {
|
||||
if (tryConnect(ha_ip1)) {
|
||||
log.info("连接到主节点,ip:{}", ha_ip1);
|
||||
System.out.println("连接到主节点,ip:" + ha_ip1);
|
||||
// System.out.println("连接到主节点,ip:" + ha_ip1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2401,7 +2402,7 @@ public class SydApi4j implements SydApi {
|
||||
// 连接到备节点
|
||||
if (tryConnect(ha_ip2)) {
|
||||
log.info("连接到备节点,ip:{}", ha_ip2);
|
||||
System.out.println("连接到备节点,ip:" + ha_ip2);
|
||||
// System.out.println("连接到备节点,ip:" + ha_ip2);
|
||||
// usingBackup.set(true);
|
||||
usingBackup.compareAndSet(false, true);
|
||||
|
||||
@ -2442,7 +2443,7 @@ public class SydApi4j implements SydApi {
|
||||
StopWatch stopWatch = new StopWatch();
|
||||
stopWatch.start();
|
||||
log.info("socket收发信息异常,准备重试:{}/当前重试:{}次", e.getMessage(),retryCount + 1);
|
||||
System.out.println("socket收发信息异常:" + e.getMessage() + ",准备重试, 当前重试:" + ++retryCount + "次");
|
||||
System.out.println(DateTime.now() + "/socket收发信息异常:" + e.getMessage() + ",准备重试, 当前重试:" + ++retryCount + "次");
|
||||
|
||||
boolean currentState = usingBackup.get();
|
||||
boolean newState = !currentState;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user