Skip to content

Commit

Permalink
Merge pull request #18 from Edge/TS-3503
Browse files Browse the repository at this point in the history
Ts 3503 - Adds the ua_first_read milestone
  • Loading branch information
shinrich committed Apr 20, 2015
2 parents ec0bfea + 3bdbc32 commit 7d25104
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions proxy/StatSystem.h
Expand Up @@ -50,10 +50,10 @@ class TransactionMilestones
{
public:
TransactionMilestones()
: ua_begin(0), ua_read_header_done(0), ua_begin_write(0), ua_close(0), server_first_connect(0), server_connect(0),
server_connect_end(0), server_begin_write(0), server_first_read(0), server_read_header_done(0), server_close(0),
cache_open_read_begin(0), cache_open_read_end(0), cache_open_write_begin(0), cache_open_write_end(0), dns_lookup_begin(0),
dns_lookup_end(0), sm_start(0), sm_finish(0)
: ua_begin(0), ua_first_read(), ua_read_header_done(0), ua_begin_write(0), ua_close(0), server_first_connect(0),
server_connect(0), server_connect_end(0), server_begin_write(0), server_first_read(0), server_read_header_done(0),
server_close(0), cache_open_read_begin(0), cache_open_read_end(0), cache_open_write_begin(0), cache_open_write_end(0),
dns_lookup_begin(0), dns_lookup_end(0), sm_start(0), sm_finish(0)
{
}

Expand All @@ -67,6 +67,7 @@ class TransactionMilestones
// first read time. //
////////////////////////////////////////////////////////
ink_hrtime ua_begin;
ink_hrtime ua_first_read;
ink_hrtime ua_read_header_done;
ink_hrtime ua_begin_write;
ink_hrtime ua_close;
Expand Down
3 changes: 3 additions & 0 deletions proxy/http/HttpSM.cc
Expand Up @@ -651,6 +651,7 @@ HttpSM::state_read_client_request_header(int event, void *data)
// the accept timeout by the HttpClientSession
//
if (client_request_hdr_bytes == 0) {
milestones.ua_first_read = ink_get_hrtime();
ua_session->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_no_activity_timeout_in));
}
/////////////////////
Expand Down Expand Up @@ -6714,6 +6715,7 @@ HttpSM::update_stats()
"client state: %d "
"server state: %d "
"ua_begin: %.3f "
"ua_first_read: %.3f "
"ua_read_header_done: %.3f "
"cache_open_read_begin: %.3f "
"cache_open_read_end: %.3f "
Expand All @@ -6728,6 +6730,7 @@ HttpSM::update_stats()
sm_id, client_ip, ats_ip_port_host_order(&t_state.client_info.addr), url_string, status, unique_id_string,
client_response_body_bytes, fd, t_state.client_info.state, t_state.server_info.state,
milestone_difference(milestones.sm_start, milestones.ua_begin),
milestone_difference(milestones.sm_start, milestones.ua_first_read),
milestone_difference(milestones.sm_start, milestones.ua_read_header_done),
milestone_difference(milestones.sm_start, milestones.cache_open_read_begin),
milestone_difference(milestones.sm_start, milestones.cache_open_read_end),
Expand Down

0 comments on commit 7d25104

Please sign in to comment.