You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by wk...@apache.org on 2023/03/01 02:24:02 UTC
[trafficserver] 02/04: sq
This is an automated email from the ASF dual-hosted git repository.
wkaras pushed a commit to branch tunnel_stats
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 944242bc22779e55b214e05ae39f463e70ef20ba
Author: Walt Karas <wk...@yahooinc.com>
AuthorDate: Mon Feb 27 00:26:11 2023 +0000
sq
---
tests/gold_tests/connect/connect.test.py | 24 ++++++++++++++----
tests/gold_tests/connect/gold/metrics.gold | 11 ++++++++
tests/gold_tests/remap/gold/remap-ws-metrics.gold | 18 +++++++++++++
tests/gold_tests/remap/remap_ws.test.py | 31 +++++++++++++++++++++++
4 files changed, 79 insertions(+), 5 deletions(-)
diff --git a/tests/gold_tests/connect/connect.test.py b/tests/gold_tests/connect/connect.test.py
index 60a5a32e0..6bdeed999 100644
--- a/tests/gold_tests/connect/connect.test.py
+++ b/tests/gold_tests/connect/connect.test.py
@@ -160,21 +160,35 @@ class ConnectViaPVTest:
tr.StillRunningAfter = self.server
tr.StillRunningAfter = self.ts
- def __testTunnelMetrics(self):
+ def __testMetrics(self):
tr = Test.AddTestRun("Reload config")
tr.Processes.Default.Command = (
- f"{Test.Variables.AtsTestToolsDir}/stdout_wait " +
- "'traffic_ctl metric get proxy.process.tunnel.total_client_connections_blind_tcp" +
- f" proxy.process.tunnel.total_server_connections_blind_tcp' {Test.TestDirectory}/gold/metrics.gold"
+ f"{Test.Variables.AtsTestToolsDir}/stdout_wait" +
+ " 'traffic_ctl metric get" +
+ " proxy.process.http.current_client_connections" +
+ " proxy.process.http.total_incoming_connections" +
+ " proxy.process.http.total_client_connections" +
+ " proxy.process.http.total_client_connections_ipv4" +
+ " proxy.process.http.total_client_connections_ipv6" +
+ " proxy.process.http.total_server_connections" +
+ " proxy.process.http.current_server_connections" +
+ " proxy.process.http.connect_requests" +
+ " proxy.process.net.connections_currently_open" +
+ " proxy.process.tunnel.total_client_connections_blind_tcp" +
+ " proxy.process.tunnel.current_client_connections_blind_tcp" +
+ " proxy.process.tunnel.total_server_connections_blind_tcp" +
+ " proxy.process.tunnel.current_server_connections_blind_tcp'" +
+ f" {Test.TestDirectory}/gold/metrics.gold"
)
# Need to copy over the environment so traffic_ctl knows where to find the unix domain socket
tr.Processes.Default.Env = self.ts.Env
tr.Processes.Default.ReturnCode = 0
+ tr.StillRunningAfter = self.server
tr.StillRunningAfter = self.ts
def run(self):
self.runTraffic()
- self.__testTunnelMetrics()
+ self.__testMetrics()
ConnectViaPVTest().run()
diff --git a/tests/gold_tests/connect/gold/metrics.gold b/tests/gold_tests/connect/gold/metrics.gold
index 8125abaf8..dbcc166e3 100644
--- a/tests/gold_tests/connect/gold/metrics.gold
+++ b/tests/gold_tests/connect/gold/metrics.gold
@@ -1,2 +1,13 @@
+proxy.process.http.current_client_connections 0
+proxy.process.http.total_incoming_connections 1
+proxy.process.http.total_client_connections 1
+proxy.process.http.total_client_connections_ipv4 1
+proxy.process.http.total_client_connections_ipv6 0
+proxy.process.http.total_server_connections 0
+proxy.process.http.current_server_connections 0
+proxy.process.http.connect_requests 1
+proxy.process.net.connections_currently_open 0
proxy.process.tunnel.total_client_connections_blind_tcp 1
+proxy.process.tunnel.current_client_connections_blind_tcp 0
proxy.process.tunnel.total_server_connections_blind_tcp 1
+proxy.process.tunnel.current_server_connections_blind_tcp 0
diff --git a/tests/gold_tests/remap/gold/remap-ws-metrics.gold b/tests/gold_tests/remap/gold/remap-ws-metrics.gold
new file mode 100644
index 000000000..b43ea440a
--- /dev/null
+++ b/tests/gold_tests/remap/gold/remap-ws-metrics.gold
@@ -0,0 +1,18 @@
+proxy.process.http.current_client_connections 0
+proxy.process.http.current_active_client_connections 0
+proxy.process.http.websocket.current_active_client_connections 0
+proxy.process.tunnel.current_active_connections 0
+proxy.process.http.total_incoming_connections 3
+proxy.process.http.total_client_connections 3
+proxy.process.http.total_client_connections_ipv4 3
+proxy.process.http.total_client_connections_ipv6 0
+proxy.process.http.total_server_connections 2
+proxy.process.https.total_client_connections 1
+proxy.process.tunnel.total_client_connections_blind_tcp 1
+proxy.process.tunnel.current_client_connections_blind_tcp 0
+proxy.process.tunnel.total_server_connections_blind_tcp 2
+proxy.process.tunnel.current_server_connections_blind_tcp 0
+proxy.process.tunnel.total_client_connections_tls_http 1
+proxy.process.tunnel.current_client_connections_tls_http 0
+proxy.process.tunnel.total_server_connections_tls_http 0
+proxy.process.tunnel.current_server_connections_tls_http 0
diff --git a/tests/gold_tests/remap/remap_ws.test.py b/tests/gold_tests/remap/remap_ws.test.py
index f87f79782..3f0d5f1d8 100644
--- a/tests/gold_tests/remap/remap_ws.test.py
+++ b/tests/gold_tests/remap/remap_ws.test.py
@@ -77,3 +77,34 @@ tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.Streams.stderr = "gold/remap-ws-upgrade-400.gold"
tr.StillRunningAfter = server
tr.StillRunningAfter = ts
+
+# Test metrics
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = (
+ f"{Test.Variables.AtsTestToolsDir}/stdout_wait" +
+ " 'traffic_ctl metric get"
+ " proxy.process.http.current_client_connections" +
+ " proxy.process.http.current_active_client_connections" +
+ " proxy.process.http.websocket.current_active_client_connections" +
+ " proxy.process.tunnel.current_active_connections" +
+ " proxy.process.http.total_incoming_connections" +
+ " proxy.process.http.total_client_connections" +
+ " proxy.process.http.total_client_connections_ipv4" +
+ " proxy.process.http.total_client_connections_ipv6" +
+ " proxy.process.http.total_server_connections" +
+ " proxy.process.https.total_client_connections" +
+ " proxy.process.tunnel.total_client_connections_blind_tcp" +
+ " proxy.process.tunnel.current_client_connections_blind_tcp" +
+ " proxy.process.tunnel.total_server_connections_blind_tcp" +
+ " proxy.process.tunnel.current_server_connections_blind_tcp" +
+ " proxy.process.tunnel.total_client_connections_tls_http" +
+ " proxy.process.tunnel.current_client_connections_tls_http" +
+ " proxy.process.tunnel.total_server_connections_tls_http" +
+ " proxy.process.tunnel.current_server_connections_tls_http'" +
+ f" {Test.TestDirectory}/gold/remap-ws-metrics.gold"
+)
+# Need to copy over the environment so traffic_ctl knows where to find the unix domain socket
+tr.Processes.Default.Env = ts.Env
+tr.Processes.Default.ReturnCode = 0
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts