Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/admin-guide/logging/formatting.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ Connections and Transactions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. _sca:
.. _surc:
.. _ssrc:
.. _sstc:
.. _ccid:
.. _ctid:
Expand All @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions proxy/logging/Log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 26 additions & 0 deletions proxy/logging/LogAccess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*-------------------------------------------------------------------------
-------------------------------------------------------------------------*/

Expand Down
26 changes: 14 additions & 12 deletions proxy/logging/LogAccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,20 @@ class LogAccess
//
// 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
Expand Down