This is an automated email from the ASF dual-hosted git repository.

lserris 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 7b427112be Add metric when parent marked down from inactive timeout 
(#12317)
7b427112be is described below

commit 7b427112be62644584d7e0ddb4dbec2f210ab216
Author: Serris Lew <[email protected]>
AuthorDate: Tue Jul 1 09:00:20 2025 -0700

    Add metric when parent marked down from inactive timeout (#12317)
    
    Co-authored-by: Serris Lew <[email protected]>
---
 include/proxy/http/HttpConfig.h | 1 +
 src/proxy/http/HttpConfig.cc    | 1 +
 src/proxy/http/HttpTransact.cc  | 7 +++++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/proxy/http/HttpConfig.h b/include/proxy/http/HttpConfig.h
index c6e5d61890..546643e51a 100644
--- a/include/proxy/http/HttpConfig.h
+++ b/include/proxy/http/HttpConfig.h
@@ -261,6 +261,7 @@ struct HttpStatsBlock {
   Metrics::Counter::AtomicType *total_client_connections_uds;
   Metrics::Counter::AtomicType *total_incoming_connections;
   Metrics::Counter::AtomicType *total_parent_marked_down_count;
+  Metrics::Counter::AtomicType *total_parent_marked_down_timeout;
   Metrics::Counter::AtomicType *total_parent_proxy_connections;
   Metrics::Counter::AtomicType *total_parent_retries;
   Metrics::Counter::AtomicType *total_parent_retries_exhausted;
diff --git a/src/proxy/http/HttpConfig.cc b/src/proxy/http/HttpConfig.cc
index a55b8a0757..90e5245085 100644
--- a/src/proxy/http/HttpConfig.cc
+++ b/src/proxy/http/HttpConfig.cc
@@ -488,6 +488,7 @@ register_stat_callbacks()
   http_rsb.total_client_connections_uds      = 
Metrics::Counter::createPtr("proxy.process.http.total_client_connections_uds");
   http_rsb.total_incoming_connections        = 
Metrics::Counter::createPtr("proxy.process.http.total_incoming_connections");
   http_rsb.total_parent_marked_down_count    = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_marked_down_count");
+  http_rsb.total_parent_marked_down_timeout  = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_marked_down_timeout");
   http_rsb.total_parent_proxy_connections    = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_proxy_connections");
   http_rsb.total_parent_retries              = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_retries");
   http_rsb.total_parent_retries_exhausted    = 
Metrics::Counter::createPtr("proxy.process.http.total_parent_retries_exhausted");
diff --git a/src/proxy/http/HttpTransact.cc b/src/proxy/http/HttpTransact.cc
index 3ff94ca5d4..b53e52b2ad 100644
--- a/src/proxy/http/HttpTransact.cc
+++ b/src/proxy/http/HttpTransact.cc
@@ -247,8 +247,11 @@ markParentDown(HttpTransact::State *s)
     return;
   }
 
-  if (s->current.state == HttpTransact::INACTIVE_TIMEOUT && 
s->txn_conf->enable_parent_timeout_markdowns == 0) {
-    return;
+  if (s->current.state == HttpTransact::INACTIVE_TIMEOUT) {
+    if (s->txn_conf->enable_parent_timeout_markdowns == 0) {
+      return;
+    }
+    Metrics::Counter::increment(http_rsb.total_parent_marked_down_timeout);
   }
   // Increment metric when config allows ATS to mark parent down
   Metrics::Counter::increment(http_rsb.total_parent_marked_down_count);

Reply via email to