Skip to content

Commit e826125

Browse files
committed
Add HTTP result code to USDT milestone_sm_finish
1 parent 40b99c7 commit e826125

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/proxy/http/HttpSM.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7732,11 +7732,14 @@ HttpSM::kill_this()
77327732
void
77337733
HttpSM::update_stats()
77347734
{
7735-
ATS_PROBE1(milestone_sm_finish, sm_id);
7735+
const HTTPStatus status_code =
7736+
t_state.hdr_info.client_response.valid() ? t_state.hdr_info.client_response.status_get() : HTTPStatus::NONE;
7737+
7738+
ATS_PROBE2(milestone_sm_finish, sm_id, static_cast<int>(status_code));
77367739
milestones[TS_MILESTONE_SM_FINISH] = ink_get_hrtime();
77377740

77387741
if (is_action_tag_set("bad_length_state_dump")) {
7739-
if (t_state.hdr_info.client_response.valid() && t_state.hdr_info.client_response.status_get() == HTTPStatus::OK) {
7742+
if (status_code == HTTPStatus::OK) {
77407743
int64_t p_resp_cl = t_state.hdr_info.client_response.get_content_length();
77417744
int64_t resp_size = client_response_body_bytes;
77427745
if (!((p_resp_cl == -1 || p_resp_cl == resp_size || resp_size == 0))) {
@@ -7815,11 +7818,7 @@ HttpSM::update_stats()
78157818
fd = -1;
78167819
}
78177820
}
7818-
// get the status code, lame that we have to check to see if it is valid or we will assert in the method call
7819-
int status = 0;
7820-
if (t_state.hdr_info.client_response.valid()) {
7821-
status = static_cast<int>(t_state.hdr_info.client_response.status_get());
7822-
}
7821+
int status = static_cast<int>(status_code);
78237822
char client_ip[INET6_ADDRSTRLEN];
78247823
ats_ip_ntop(&t_state.client_info.src_addr, client_ip, sizeof(client_ip));
78257824
Error("[%" PRId64 "] Slow Request: "

0 commit comments

Comments
 (0)