fix(性能测试): 查询 service 区分端口
This commit is contained in:
parent
1db9dadbfd
commit
b95ce0a221
|
@ -80,7 +80,9 @@ public class CatalogApiController {
|
||||||
.body(JSON.parseArray("[]"));
|
.body(JSON.parseArray("[]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] ipAndPort = service.split("-");
|
int i = service.lastIndexOf("-");
|
||||||
|
String address = service.substring(0, i);
|
||||||
|
String port = service.substring(i);
|
||||||
String result = "[\n" +
|
String result = "[\n" +
|
||||||
" {\n" +
|
" {\n" +
|
||||||
" \"Node\": {\n" +
|
" \"Node\": {\n" +
|
||||||
|
@ -106,9 +108,9 @@ public class CatalogApiController {
|
||||||
" \"Tags\": [\n" +
|
" \"Tags\": [\n" +
|
||||||
" \"test\"\n" +
|
" \"test\"\n" +
|
||||||
" ],\n" +
|
" ],\n" +
|
||||||
" \"Address\": \"" + ipAndPort[0] + "\",\n" +
|
" \"Address\": \"" + address + "\",\n" +
|
||||||
" \"Meta\": null,\n" +
|
" \"Meta\": null,\n" +
|
||||||
" \"Port\": " + ipAndPort[1] + ",\n" +
|
" \"Port\": " + port + ",\n" +
|
||||||
" \"Weights\": {\n" +
|
" \"Weights\": {\n" +
|
||||||
" \"Passing\": 1,\n" +
|
" \"Passing\": 1,\n" +
|
||||||
" \"Warning\": 1\n" +
|
" \"Warning\": 1\n" +
|
||||||
|
|
Loading…
Reference in New Issue