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

bnolsen 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 2c84be4887 Add ssrc and surc log fields for server simple/unavail 
retry counts. (#9694)
2c84be4887 is described below

commit 2c84be4887df7972c6741f88fb6366c86bc81808
Author: Brian Olsen <[email protected]>
AuthorDate: Tue May 30 06:36:44 2023 -0600

    Add ssrc and surc log fields for server simple/unavail retry counts. (#9694)
    
    * Add psrc and psuc log fields for parent simple/unavail retry counts.
    
    * rename from 'parent' to 'server
    
    ---------
    
    Co-authored-by: Brian Olsen <[email protected]>
---
 doc/admin-guide/logging/formatting.en.rst |  4 ++++
 proxy/logging/Log.cc                      | 10 ++++++++++
 proxy/logging/LogAccess.cc                | 26 ++++++++++++++++++++++++++
 proxy/logging/LogAccess.h                 | 26 ++++++++++++++------------
 4 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/doc/admin-guide/logging/formatting.en.rst 
b/doc/admin-guide/logging/formatting.en.rst
index d87fa62659..76a4dc1067 100644
--- a/doc/admin-guide/logging/formatting.en.rst
+++ b/doc/admin-guide/logging/formatting.en.rst
@@ -193,6 +193,8 @@ Connections and Transactions
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 .. _sca:
+.. _surc:
+.. _ssrc:
 .. _sstc:
 .. _ccid:
 .. _ctid:
@@ -207,6 +209,8 @@ Field Source         Description
 ===== ============== 
==================================================================
 sca   Proxy          Number of attempts within the current transaction by |TS|
                      in connecting to the origin server.
+surc  Proxy          Parent unavailable retry count within the current 
transaction by |TS|.
+ssrc  Proxy          Parent simple server retry count within the current 
transaction by |TS|.
 sstc  Proxy          Number of transactions between the |TS| proxy and the 
origin
                      server from a single session. Any value greater than zero
                      indicates connection reuse.
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 5af69fffc5..1f0435d3b7 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -831,6 +831,16 @@ Log::init_fields()
   global_field_list.add(field, false);
   field_symbol_hash.emplace("sstc", field);
 
+  field = new LogField("server_unavailable_retry_count", "surc", 
LogField::sINT, &LogAccess::marshal_server_unavailable_retry_count,
+                       &LogAccess::unmarshal_int_to_str);
+  global_field_list.add(field, false);
+  field_symbol_hash.emplace("surc", field);
+
+  field = new LogField("server_simple_retry_count", "ssrc", LogField::sINT, 
&LogAccess::marshal_server_simple_retry_count,
+                       &LogAccess::unmarshal_int_to_str);
+  global_field_list.add(field, false);
+  field_symbol_hash.emplace("ssrc", field);
+
   field = new LogField("server_connect_attempts", "sca", LogField::sINT, 
&LogAccess::marshal_server_connect_attempts,
                        &LogAccess::unmarshal_int_to_str);
   global_field_list.add(field, false);
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index b58dbbcab7..3a52f040c2 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -2626,6 +2626,32 @@ LogAccess::marshal_server_transact_count(char *buf)
   return INK_MIN_ALIGN;
 }
 
+/*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
+int
+LogAccess::marshal_server_simple_retry_count(char *buf)
+{
+  if (buf) {
+    const int64_t attempts = m_http_sm->t_state.current.simple_retry_attempts;
+    marshal_int(buf, attempts);
+  }
+  return INK_MIN_ALIGN;
+}
+
+/*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
+int
+LogAccess::marshal_server_unavailable_retry_count(char *buf)
+{
+  if (buf) {
+    const int64_t attempts = 
m_http_sm->t_state.current.unavailable_server_retry_attempts;
+    marshal_int(buf, attempts);
+  }
+  return INK_MIN_ALIGN;
+}
+
 /*-------------------------------------------------------------------------
   -------------------------------------------------------------------------*/
 
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index c95ad18431..08bfb8f395 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -195,18 +195,20 @@ public:
   //
   // server -> proxy fields
   //
-  int marshal_server_host_ip(char *);                // INT
-  int marshal_server_host_name(char *);              // STR
-  int marshal_server_resp_status_code(char *);       // INT
-  int marshal_server_resp_squid_len(char *);         // INT
-  int marshal_server_resp_content_len(char *);       // INT
-  int marshal_server_resp_header_len(char *);        // INT
-  int marshal_server_resp_http_version(char *);      // INT
-  int marshal_server_resp_time_ms(char *);           // INT
-  int marshal_server_resp_time_s(char *);            // INT
-  int marshal_server_transact_count(char *);         // INT
-  int marshal_server_connect_attempts(char *);       // INT
-  int marshal_server_resp_all_header_fields(char *); // STR
+  int marshal_server_host_ip(char *);                 // INT
+  int marshal_server_host_name(char *);               // STR
+  int marshal_server_resp_status_code(char *);        // INT
+  int marshal_server_resp_squid_len(char *);          // INT
+  int marshal_server_resp_content_len(char *);        // INT
+  int marshal_server_resp_header_len(char *);         // INT
+  int marshal_server_resp_http_version(char *);       // INT
+  int marshal_server_resp_time_ms(char *);            // INT
+  int marshal_server_resp_time_s(char *);             // INT
+  int marshal_server_transact_count(char *);          // INT
+  int marshal_server_simple_retry_count(char *);      // INT
+  int marshal_server_unavailable_retry_count(char *); // INT
+  int marshal_server_connect_attempts(char *);        // INT
+  int marshal_server_resp_all_header_fields(char *);  // STR
 
   //
   // cache -> client fields

Reply via email to