Skip to content

Commit

Permalink
[Improve][Restapi] Add ip and port to monitoring information (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
liugddx authored Jul 22, 2024
1 parent c4ca741 commit 063f83c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ public void testSystemMonitoringInformation() {
.then()
.assertThat()
.time(lessThan(5000L))
.body("[0].host", equalTo("localhost"))
.body("[0].port", notNullValue())
.statusCode(200);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ boolean exceedsThreshold() {
public String render() {
update();
sb.setLength(0);
ipPort();
renderProcessors();
renderPhysicalMemory();
renderSwap();
Expand All @@ -220,6 +221,11 @@ public String render() {
return sb.toString();
}

private void ipPort() {
sb.append("host=").append(node.address.getHost()).append(", ");
sb.append("port=").append(node.address.getPort()).append(", ");
}

private void renderConnection() {
sb.append("connection.active.count=")
.append(tcpConnectionActiveCount.read())
Expand Down

0 comments on commit 063f83c

Please sign in to comment.