Skip to content
Closed
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
7 changes: 7 additions & 0 deletions doc/admin/event-logging-formats.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,13 @@ The following list describes Traffic Server custom logging fields.
``sts``
The time Traffic Server spends accessing the origin, in seconds.

.. _sstc:

``sstc``
The number of transactions between Traffic Server and the origin server
from a single server session. A value greater than 0 indicates connection
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greater than 0 because we do the postfix increment

reuse.

.. _ttms:

``ttms``
Expand Down
7 changes: 4 additions & 3 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ HttpSM::HttpSM()
server_response_hdr_bytes(0), server_response_body_bytes(0), client_response_hdr_bytes(0), client_response_body_bytes(0),
cache_response_hdr_bytes(0), cache_response_body_bytes(0), pushed_response_hdr_bytes(0), pushed_response_body_bytes(0),
client_tcp_reused(false), client_ssl_reused(false), client_connection_is_ssl(false), client_sec_protocol("-"),
client_cipher_suite("-"), plugin_tag(0), plugin_id(0), hooks_set(false), cur_hook_id(TS_HTTP_LAST_HOOK), cur_hook(NULL),
cur_hooks(0), callout_state(HTTP_API_NO_CALLOUT), terminate_sm(false), kill_this_async_done(false), parse_range_done(false)
client_cipher_suite("-"), server_transact_count(0), plugin_tag(0), plugin_id(0), hooks_set(false), cur_hook_id(TS_HTTP_LAST_HOOK),
cur_hook(NULL), cur_hooks(0), callout_state(HTTP_API_NO_CALLOUT), terminate_sm(false), kill_this_async_done(false),
parse_range_done(false)
{
memset(&history, 0, sizeof(history));
memset(&vc_table, 0, sizeof(vc_table));
Expand Down Expand Up @@ -5609,7 +5610,7 @@ HttpSM::attach_server_session(HttpServerSession *s)
hsm_release_assert(server_entry == NULL);
hsm_release_assert(s->state == HSS_ACTIVE);
server_session = s;
server_session->transact_count++;
server_transact_count = server_session->transact_count++;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant, but we need the additional value because the server_session is gone at logging time


// Set the mutex so that we have something to update
// stats with
Expand Down
1 change: 1 addition & 0 deletions proxy/http/HttpSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ class HttpSM : public Continuation
bool client_connection_is_ssl;
const char *client_sec_protocol;
const char *client_cipher_suite;
int server_transact_count;

TransactionMilestones milestones;
ink_hrtime api_timer;
Expand Down
5 changes: 5 additions & 0 deletions proxy/logging/Log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,11 @@ Log::init_fields()
global_field_list.add(field, false);
ink_hash_table_insert(field_symbol_hash, "sts", field);

field = new LogField("server_transact_count", "sstc", LogField::sINT, &LogAccess::marshal_server_transact_count,
&LogAccess::unmarshal_int_to_str);
global_field_list.add(field, false);
ink_hash_table_insert(field_symbol_hash, "sstc", field);

field = new LogField("cached_resp_status_code", "csssc", LogField::sINT, &LogAccess::marshal_cache_resp_status_code,
&LogAccess::unmarshal_http_status);
global_field_list.add(field, false);
Expand Down
7 changes: 7 additions & 0 deletions proxy/logging/LogAccess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,13 @@ LogAccess::marshal_server_resp_time_s(char *buf)
DEFAULT_INT_FIELD;
}

/*-------------------------------------------------------------------------
-------------------------------------------------------------------------*/
int
LogAccess::marshal_server_transact_count(char *buf)
{
DEFAULT_INT_FIELD;
}

/*-------------------------------------------------------------------------
-------------------------------------------------------------------------*/
Expand Down
1 change: 1 addition & 0 deletions proxy/logging/LogAccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class LogAccess
inkcoreapi virtual int marshal_server_resp_http_version(char *); // INT
inkcoreapi virtual int marshal_server_resp_time_ms(char *); // INT
inkcoreapi virtual int marshal_server_resp_time_s(char *); // INT
inkcoreapi virtual int marshal_server_transact_count(char *); // INT

//
// cache -> client fields
Expand Down
14 changes: 14 additions & 0 deletions proxy/logging/LogAccessHttp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,20 @@ LogAccessHttp::marshal_server_resp_time_s(char *buf)
return INK_MIN_ALIGN;
}

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

int
LogAccessHttp::marshal_server_transact_count(char *buf)
{
if (buf) {
int64_t count;
count = m_http_sm->server_transact_count;
marshal_int(buf, count);
}
return INK_MIN_ALIGN;
}

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

Expand Down
1 change: 1 addition & 0 deletions proxy/logging/LogAccessHttp.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class LogAccessHttp : public LogAccess
virtual int marshal_server_resp_http_version(char *); // INT
virtual int marshal_server_resp_time_ms(char *); // INT
virtual int marshal_server_resp_time_s(char *); // INT
virtual int marshal_server_transact_count(char *); // INT

//
// cache -> client fields
Expand Down