This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 79a347345d Add thread_groups to server status result (#12506)
79a347345d is described below
commit 79a347345df6aa49a03f9b947b2ff32212eea2c4
Author: Chris McFarlen <[email protected]>
AuthorDate: Fri Sep 12 13:11:31 2025 -0500
Add thread_groups to server status result (#12506)
* Add thread_groups to server status result
* update autest expected output
---
src/mgmt/rpc/handlers/server/Server.cc | 14 ++++++++++++++
.../traffic_ctl/traffic_ctl_server_output.test.py | 4 ++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/mgmt/rpc/handlers/server/Server.cc
b/src/mgmt/rpc/handlers/server/Server.cc
index bd251a8f52..f429d0787c 100644
--- a/src/mgmt/rpc/handlers/server/Server.cc
+++ b/src/mgmt/rpc/handlers/server/Server.cc
@@ -19,6 +19,7 @@
*/
#include "../../../../iocore/cache/P_CacheDir.h"
+#include "iocore/eventsystem/EventProcessor.h"
#include "iocore/net/ConnectionTracker.h"
#include "mgmt/rpc/handlers/server/Server.h"
#include "mgmt/rpc/handlers/common/ErrorUtils.h"
@@ -194,6 +195,19 @@ get_server_status(std::string_view const & /* params
ATS_UNUSED */, YAML::Node c
data["is_draining"] = bts(TSSystemState::is_draining());
data["is_event_system_shut_down"] =
bts(TSSystemState::is_event_system_shut_down());
+ YAML::Node threads;
+ for (const auto &tgs : eventProcessor.thread_group) {
+ if (!tgs._name.empty()) {
+ YAML::Node grp;
+ grp["name"] = tgs._name;
+ grp["count"] = YAML::Node(tgs._count).Scalar();
+ grp["started"] = bts(tgs._started.load());
+ threads.push_back(grp);
+ }
+ }
+
+ data["thread_groups"] = threads;
+
resp.result()["data"] = data;
} catch (std::exception const &ex) {
diff --git a/tests/gold_tests/traffic_ctl/traffic_ctl_server_output.test.py
b/tests/gold_tests/traffic_ctl/traffic_ctl_server_output.test.py
index c6362de166..0b8b0968c6 100644
--- a/tests/gold_tests/traffic_ctl/traffic_ctl_server_output.test.py
+++ b/tests/gold_tests/traffic_ctl/traffic_ctl_server_output.test.py
@@ -34,14 +34,14 @@ traffic_ctl = Make_traffic_ctl(Test)
######
# traffic_ctl server status
traffic_ctl.server().status().validate_with_text(
- '{"initialized_done": "true", "is_ssl_handshaking_stopped": "false",
"is_draining": "false", "is_event_system_shut_down": "false"}'
+ '{"initialized_done": "true", "is_ssl_handshaking_stopped": "false",
"is_draining": "false", "is_event_system_shut_down": "false", "thread_groups":
[{"name": "ET_NET", "count": "4", "started": "true"}, {"name": "ET_TASK",
"count": "2", "started": "true"}, {"name": "ET_UDP", "count": "0", "started":
"false"}]}'
)
# Drain ats so we can check the output.
traffic_ctl.server().drain().exec()
# After the drain, server status should reflect this change.
traffic_ctl.server().status().validate_with_text(
- '{"initialized_done": "true", "is_ssl_handshaking_stopped": "false",
"is_draining": "true", "is_event_system_shut_down": "false"}'
+ '{"initialized_done": "true", "is_ssl_handshaking_stopped": "false",
"is_draining": "true", "is_event_system_shut_down": "false", "thread_groups":
[{"name": "ET_NET", "count": "4", "started": "true"}, {"name": "ET_TASK",
"count": "2", "started": "true"}, {"name": "ET_UDP", "count": "0", "started":
"false"}]}'
)
# Get basic and empty connection tracker info.