This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.1.x by this push:
new 3c4b817 Add pooled_server_connections metric (#7627)
3c4b817 is described below
commit 3c4b81765629d33077fc4d03baa2e9289f424ea2
Author: Susan Hinrichs <[email protected]>
AuthorDate: Mon Mar 29 08:14:54 2021 -0500
Add pooled_server_connections metric (#7627)
(cherry picked from commit ede54c16ab951ecff60d17482fad16e5627070bf)
---
doc/admin-guide/monitoring/statistics/core/http-connection.en.rst | 6 ++++++
proxy/http/HttpConfig.cc | 4 ++++
proxy/http/HttpConfig.h | 1 +
proxy/http/HttpSessionManager.cc | 5 +++++
4 files changed, 16 insertions(+)
diff --git a/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
b/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
index 42c680e..80ffff4 100644
--- a/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
+++ b/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
@@ -138,6 +138,12 @@ HTTP Connection
This tracks the number of origin connections denied due to being over the
:ts:cv:`proxy.config.http.per_server.connection.max` limit.
+.. ts:stat:: global proxy.process.http.pooled_server_connections integer
+ :type: counter
+
+ This metric tracks the number of server connections currently in the server
session sharing pools. The server session sharing is
+ controlled by settings
:ts:cv:`proxy.config.http.server_session_sharing.pool` and
:ts:cv:`proxy.config.http.server_session_sharing.match`.
+
HTTP/2
------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index ec2f85f..17a8e47 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -413,6 +413,10 @@ register_stat_callbacks()
RECP_PERSISTENT,
(int)http_ua_msecs_counts_errors_pre_accept_hangups_stat,
RecRawStatSyncIntMsecsToFloatSeconds);
+ RecRegisterRawStat(http_rsb, RECT_PROCESS,
"proxy.process.http.pooled_server_connections", RECD_INT, RECP_NON_PERSISTENT,
+ (int)http_pooled_server_connections_stat,
RecRawStatSyncSum);
+ HTTP_CLEAR_DYN_STAT(http_pooled_server_connections_stat);
+
// Transactional stats
RecRegisterRawStat(http_rsb, RECT_PROCESS,
"proxy.process.http.incoming_requests", RECD_COUNTER, RECP_PERSISTENT,
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 8bce939..e71e24d 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -65,6 +65,7 @@ enum {
http_current_client_transactions_stat,
http_total_incoming_connections_stat,
http_current_server_transactions_stat,
+ http_pooled_server_connections_stat,
// Http Abort information (from HttpNetConnection)
http_ua_msecs_counts_errors_pre_accept_hangups_stat,
diff --git a/proxy/http/HttpSessionManager.cc b/proxy/http/HttpSessionManager.cc
index 2cee24e..4f7fabb 100644
--- a/proxy/http/HttpSessionManager.cc
+++ b/proxy/http/HttpSessionManager.cc
@@ -165,6 +165,7 @@ ServerSessionPool::acquireSession(sockaddr const *addr,
CryptoHash const &hostna
}
if (zret == HSM_DONE) {
to_return = first;
+ HTTP_DECREMENT_DYN_STAT(http_pooled_server_connections_stat);
m_fqdn_pool.erase(first);
m_ip_pool.erase(to_return);
}
@@ -189,6 +190,7 @@ ServerSessionPool::acquireSession(sockaddr const *addr,
CryptoHash const &hostna
}
if (zret == HSM_DONE) {
to_return = first;
+ HTTP_DECREMENT_DYN_STAT(http_pooled_server_connections_stat);
m_ip_pool.erase(first);
m_fqdn_pool.erase(to_return);
}
@@ -216,6 +218,8 @@ ServerSessionPool::releaseSession(PoolableSession *ss)
m_ip_pool.insert(ss);
m_fqdn_pool.insert(ss);
+ HTTP_INCREMENT_DYN_STAT(http_pooled_server_connections_stat);
+
Debug("http_ss",
"[%" PRId64 "] [release session] "
"session placed into shared pool",
@@ -286,6 +290,7 @@ ServerSessionPool::eventHandler(int event, void *data)
// Drop connection on this end.
s->do_io_close();
found = true;
+ HTTP_DECREMENT_DYN_STAT(http_pooled_server_connections_stat);
break;
}
}