You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2015/07/08 18:12:28 UTC
trafficserver git commit: TS-2150: Unify milestone enums.
Repository: trafficserver
Updated Branches:
refs/heads/master eb4fafeb5 -> 82b09e0be
TS-2150: Unify milestone enums.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/82b09e0b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/82b09e0b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/82b09e0b
Branch: refs/heads/master
Commit: 82b09e0bea35c028bc7fe009be16bc41326bfda2
Parents: eb4fafe
Author: Alan M. Carroll <am...@apache.org>
Authored: Wed Jul 8 10:49:02 2015 -0500
Committer: Alan M. Carroll <so...@yahoo-inc.com>
Committed: Wed Jul 8 11:11:17 2015 -0500
----------------------------------------------------------------------
proxy/InkAPI.cc | 5 +-
proxy/StatSystem.h | 70 +++------------------
proxy/http/HttpSM.cc | 120 ++++++++++++++++++------------------
proxy/http/HttpTransact.cc | 40 ++++++------
proxy/logging/Log.cc | 2 +-
proxy/logging/LogAccess.cc | 4 +-
proxy/logging/LogAccess.h | 4 +-
proxy/logging/LogAccessHttp.cc | 12 ++--
proxy/logging/LogAccessHttp.h | 4 +-
proxy/logging/LogField.cc | 66 ++++++++++----------
proxy/logging/LogField.h | 8 +--
11 files changed, 139 insertions(+), 196 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 16973b1..8fa4fc4 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -5933,12 +5933,11 @@ TSHttpTxnMilestoneGet(TSHttpTxn txnp, TSMilestonesType milestone, ink_hrtime *ti
HttpSM *sm = (HttpSM *)txnp;
TSReturnCode ret = TS_SUCCESS;
- if ((milestone < (TSMilestonesType)TransactionMilestones::UA_BEGIN) ||
- (milestone >= (TSMilestonesType)TransactionMilestones::LAST_ENTRY)) {
+ if ((milestone < TS_MILESTONE_UA_BEGIN) || (milestone >= TS_MILESTONE_LAST_ENTRY)) {
*time = -1;
ret = TS_ERROR;
} else {
- *time = sm->milestones[(TransactionMilestones::Milestone)milestone];
+ *time = sm->milestones[milestone];
}
return ret;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/StatSystem.h
----------------------------------------------------------------------
diff --git a/proxy/StatSystem.h b/proxy/StatSystem.h
index 4a537dc..616aa43 100644
--- a/proxy/StatSystem.h
+++ b/proxy/StatSystem.h
@@ -37,6 +37,7 @@
#endif
#include "ink_apidefs.h"
+#include "apidefs.h"
#define STATS_MAJOR_VERSION 6 // increment when changing the stats!
#define DEFAULT_SNAP_FILENAME "stats.snap"
@@ -49,69 +50,12 @@
class TransactionMilestones
{
public:
- // Used for array indexes, insert new value before _LAST one
- enum Milestone {
- ////////////////////////////////////////////////////////
- // user agent: //
- // user_agent_begin represents the time this //
- // transaction started. If this is the first //
- // transaction in a connection, then user_agent_begin //
- // is set to accept time. otherwise it is set to //
- // first read time. //
- ////////////////////////////////////////////////////////
- UA_BEGIN = 0,
- UA_FIRST_READ,
- UA_READ_HEADER_DONE,
- UA_BEGIN_WRITE,
- UA_CLOSE,
-
- ////////////////////////////////////////////////////////
- // server (origin_server , parent, blind tunnnel //
- ////////////////////////////////////////////////////////
- SERVER_FIRST_CONNECT,
- SERVER_CONNECT,
- SERVER_CONNECT_END,
- SERVER_BEGIN_WRITE, // http only
- SERVER_FIRST_READ, // http only
- SERVER_READ_HEADER_DONE, // http only
- SERVER_CLOSE,
-
- CACHE_OPEN_READ_BEGIN,
- CACHE_OPEN_READ_END,
- CACHE_OPEN_WRITE_BEGIN,
- CACHE_OPEN_WRITE_END,
-
- DNS_LOOKUP_BEGIN,
- DNS_LOOKUP_END,
-
- ///////////////////
- // state machine //
- ///////////////////
- SM_START,
- SM_FINISH,
-
- //////////////////
- // API activity //
- //////////////////
- // Total amount of time spent in API calls converted to a timestamp.
- // (subtract @a sm_start to get the actual time)
- /// Time spent in API callout.
- PLUGIN_ACTIVE,
- /// Time spent in API state during the transaction.
- PLUGIN_TOTAL,
- LAST_ENTRY
- // TODO: Should we instrument these at some point?
- // CACHE_READ_BEGIN;
- // CACHE_READ_END;
- // CACHE_WRITE_BEGIN;
- // CACHE_WRITE_END;
- };
TransactionMilestones() { ink_zero(milestones); }
- ink_hrtime &operator[](Milestone ms) { return milestones[ms]; }
+ ink_hrtime& operator[] (TSMilestonesType ms) { return milestones[ms]; }
- const ink_hrtime &operator[](Milestone ms) const { return milestones[ms]; }
+ ink_hrtime operator[] (TSMilestonesType ms) const { return milestones[ms]; }
/**
* Takes two milestones and returns the difference.
@@ -120,7 +64,7 @@ public:
* @return A double that is the time in seconds
*/
int64_t
- difference_msec(Milestone ms_start, Milestone ms_end) const
+ difference_msec(TSMilestonesType ms_start, TSMilestonesType ms_end) const
{
if (milestones[ms_end] == 0) {
return -1;
@@ -129,7 +73,7 @@ public:
}
double
- difference(Milestone ms_start, Milestone ms_end) const
+ difference(TSMilestonesType ms_start, TSMilestonesType ms_end) const
{
if (milestones[ms_end] == 0) {
return -1;
@@ -138,13 +82,13 @@ public:
}
ink_hrtime
- elapsed(Milestone ms_start, Milestone ms_end) const
+ elapsed(TSMilestonesType ms_start, TSMilestonesType ms_end) const
{
return milestones[ms_end] - milestones[ms_start];
}
private:
- ink_hrtime milestones[LAST_ENTRY];
+ ink_hrtime milestones[TS_MILESTONE_LAST_ENTRY];
};
// Modularization Project: Build w/o thread-local-dyn-stats
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index dee708b..af06f96 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -103,13 +103,13 @@ milestone_update_api_time(TransactionMilestones &milestones, ink_hrtime &api_tim
if (0 == delta)
++delta;
- if (0 == milestones[TransactionMilestones::PLUGIN_TOTAL])
- milestones[TransactionMilestones::PLUGIN_TOTAL] = milestones[TransactionMilestones::SM_START];
- milestones[TransactionMilestones::PLUGIN_TOTAL] = milestones[TransactionMilestones::PLUGIN_TOTAL] + delta;
+ if (0 == milestones[TS_MILESTONE_PLUGIN_TOTAL])
+ milestones[TS_MILESTONE_PLUGIN_TOTAL] = milestones[TS_MILESTONE_SM_START];
+ milestones[TS_MILESTONE_PLUGIN_TOTAL] = milestones[TS_MILESTONE_PLUGIN_TOTAL] + delta;
if (active) {
- if (0 == milestones[TransactionMilestones::PLUGIN_ACTIVE])
- milestones[TransactionMilestones::PLUGIN_ACTIVE] = milestones[TransactionMilestones::SM_START];
- milestones[TransactionMilestones::PLUGIN_ACTIVE] = milestones[TransactionMilestones::PLUGIN_ACTIVE] + delta;
+ if (0 == milestones[TS_MILESTONE_PLUGIN_ACTIVE])
+ milestones[TS_MILESTONE_PLUGIN_ACTIVE] = milestones[TS_MILESTONE_SM_START];
+ milestones[TS_MILESTONE_PLUGIN_ACTIVE] = milestones[TS_MILESTONE_PLUGIN_ACTIVE] + delta;
}
}
}
@@ -318,7 +318,7 @@ HttpSM::destroy()
void
HttpSM::init()
{
- milestones[TransactionMilestones::SM_START] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SM_START] = Thread::get_hrtime();
magic = HTTP_SM_MAGIC_ALIVE;
sm_id = 0;
@@ -469,7 +469,7 @@ HttpSM::start_sub_sm()
void
HttpSM::attach_client_session(HttpClientSession *client_vc, IOBufferReader *buffer_reader)
{
- milestones[TransactionMilestones::UA_BEGIN] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_UA_BEGIN] = Thread::get_hrtime();
ink_assert(client_vc != NULL);
ua_session = client_vc;
@@ -614,7 +614,7 @@ HttpSM::state_read_client_request_header(int event, void *data)
// the accept timeout by the HttpClientSession
//
if (client_request_hdr_bytes == 0) {
- milestones[TransactionMilestones::UA_FIRST_READ] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_UA_FIRST_READ] = Thread::get_hrtime();
ua_session->get_netvc()->set_inactivity_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_no_activity_timeout_in));
}
/////////////////////
@@ -677,7 +677,7 @@ HttpSM::state_read_client_request_header(int event, void *data)
}
http_parser_clear(&http_parser);
ua_entry->vc_handler = &HttpSM::state_watch_for_client_abort;
- milestones[TransactionMilestones::UA_READ_HEADER_DONE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_UA_READ_HEADER_DONE] = Thread::get_hrtime();
}
switch (state) {
@@ -867,7 +867,7 @@ HttpSM::state_watch_for_client_abort(int event, void *data)
ua_entry->read_vio->nbytes = ua_entry->read_vio->ndone;
}
mark_server_down_on_client_abort();
- milestones[TransactionMilestones::UA_CLOSE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_UA_CLOSE] = Thread::get_hrtime();
set_ua_abort(HttpTransact::ABORTED, event);
terminate_sm = true;
break;
@@ -1008,7 +1008,7 @@ HttpSM::state_read_push_response_header(int event, void *data)
// Disable further IO
ua_entry->read_vio->nbytes = ua_entry->read_vio->ndone;
http_parser_clear(&http_parser);
- milestones[TransactionMilestones::SERVER_READ_HEADER_DONE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_READ_HEADER_DONE] = Thread::get_hrtime();
}
switch (state) {
@@ -1042,7 +1042,7 @@ HttpSM::state_raw_http_server_open(int event, void *data)
{
STATE_ENTER(&HttpSM::state_raw_http_server_open, event);
ink_assert(server_entry == NULL);
- milestones[TransactionMilestones::SERVER_CONNECT_END] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_CONNECT_END] = Thread::get_hrtime();
NetVConnection *netvc = NULL;
pending_action = NULL;
@@ -1612,7 +1612,7 @@ HttpSM::state_http_server_open(int event, void *data)
// TODO decide whether to uncomment after finish testing redirect
// ink_assert(server_entry == NULL);
pending_action = NULL;
- milestones[TransactionMilestones::SERVER_CONNECT_END] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_CONNECT_END] = Thread::get_hrtime();
HttpServerSession *session;
switch (event) {
@@ -1742,7 +1742,7 @@ HttpSM::state_read_server_response_header(int event, void *data)
// the connect timeout when we set up to read the header
//
if (server_response_hdr_bytes == 0) {
- milestones[TransactionMilestones::SERVER_FIRST_READ] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_FIRST_READ] = Thread::get_hrtime();
if (t_state.api_txn_no_activity_timeout_value != -1) {
server_session->get_netvc()->set_inactivity_timeout(HRTIME_MSECONDS(t_state.api_txn_no_activity_timeout_value));
@@ -1779,7 +1779,7 @@ HttpSM::state_read_server_response_header(int event, void *data)
// Disable further IO
server_entry->read_vio->nbytes = server_entry->read_vio->ndone;
http_parser_clear(&http_parser);
- milestones[TransactionMilestones::SERVER_READ_HEADER_DONE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_READ_HEADER_DONE] = Thread::get_hrtime();
}
switch (state) {
@@ -2086,11 +2086,11 @@ HttpSM::process_hostdb_info(HostDBInfo *r)
ink_assert(!t_state.host_db_info.round_robin);
}
- milestones[TransactionMilestones::DNS_LOOKUP_END] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_DNS_LOOKUP_END] = Thread::get_hrtime();
if (is_debug_tag_set("http_timeout")) {
if (t_state.api_txn_dns_timeout_value != -1) {
- int foo = (int)(milestones.difference_msec(TransactionMilestones::DNS_LOOKUP_BEGIN, TransactionMilestones::DNS_LOOKUP_END));
+ int foo = (int)(milestones.difference_msec(TS_MILESTONE_DNS_LOOKUP_BEGIN, TS_MILESTONE_DNS_LOOKUP_END));
DebugSM("http_timeout", "DNS took: %d msec", foo);
}
}
@@ -2353,7 +2353,7 @@ int
HttpSM::state_cache_open_write(int event, void *data)
{
STATE_ENTER(&HttpSM : state_cache_open_write, event);
- milestones[TransactionMilestones::CACHE_OPEN_WRITE_END] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_CACHE_OPEN_WRITE_END] = Thread::get_hrtime();
pending_action = NULL;
switch (event) {
@@ -2454,7 +2454,7 @@ int
HttpSM::state_cache_open_read(int event, void *data)
{
STATE_ENTER(&HttpSM::state_cache_open_read, event);
- milestones[TransactionMilestones::CACHE_OPEN_READ_END] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_CACHE_OPEN_READ_END] = Thread::get_hrtime();
ink_assert(server_entry == NULL);
ink_assert(t_state.cache_info.object_read == 0);
@@ -2837,7 +2837,7 @@ HttpSM::tunnel_handler_server(int event, HttpTunnelProducer *p)
{
STATE_ENTER(&HttpSM::tunnel_handler_server, event);
- milestones[TransactionMilestones::SERVER_CLOSE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_CLOSE] = Thread::get_hrtime();
bool close_connection = false;
@@ -3077,7 +3077,7 @@ HttpSM::tunnel_handler_ua(int event, HttpTunnelConsumer *c)
STATE_ENTER(&HttpSM::tunnel_handler_ua, event);
ink_assert(c->vc == ua_session);
- milestones[TransactionMilestones::UA_CLOSE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_UA_CLOSE] = Thread::get_hrtime();
switch (event) {
case VC_EVENT_EOS:
@@ -3924,7 +3924,7 @@ HttpSM::do_hostdb_lookup()
ink_assert(t_state.dns_info.lookup_name != NULL);
ink_assert(pending_action == NULL);
- milestones[TransactionMilestones::DNS_LOOKUP_BEGIN] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_DNS_LOOKUP_BEGIN] = Thread::get_hrtime();
bool use_srv_records = t_state.srv_lookup;
if (use_srv_records) {
@@ -4355,7 +4355,7 @@ HttpSM::do_cache_lookup_and_read()
HTTP_INCREMENT_TRANS_STAT(http_cache_lookups_stat);
- milestones[TransactionMilestones::CACHE_OPEN_READ_BEGIN] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_CACHE_OPEN_READ_BEGIN] = Thread::get_hrtime();
t_state.cache_lookup_result = HttpTransact::CACHE_LOOKUP_NONE;
t_state.cache_info.lookup_count++;
// YTS Team, yamsat Plugin
@@ -4422,7 +4422,7 @@ HttpSM::do_cache_prepare_write()
{
// statistically no need to retry when we are trying to lock
// LOCK_URL_SECOND url because the server's behavior is unlikely to change
- milestones[TransactionMilestones::CACHE_OPEN_WRITE_BEGIN] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_CACHE_OPEN_WRITE_BEGIN] = Thread::get_hrtime();
bool retry = (t_state.api_lock_url == HttpTransact::LOCK_URL_FIRST);
do_cache_prepare_action(&cache_sm, t_state.cache_info.object_read, retry);
}
@@ -4554,20 +4554,20 @@ HttpSM::do_http_server_open(bool raw)
DebugSM("http_seq", "[HttpSM::do_http_server_open] Sending request to server");
- milestones[TransactionMilestones::SERVER_CONNECT] = Thread::get_hrtime();
- if (milestones[TransactionMilestones::SERVER_FIRST_CONNECT] == 0) {
- milestones[TransactionMilestones::SERVER_FIRST_CONNECT] = milestones[TransactionMilestones::SERVER_CONNECT];
+ milestones[TS_MILESTONE_SERVER_CONNECT] = Thread::get_hrtime();
+ if (milestones[TS_MILESTONE_SERVER_FIRST_CONNECT] == 0) {
+ milestones[TS_MILESTONE_SERVER_FIRST_CONNECT] = milestones[TS_MILESTONE_SERVER_CONNECT];
}
if (t_state.pCongestionEntry != NULL) {
if (t_state.pCongestionEntry->F_congested() &&
- (!t_state.pCongestionEntry->proxy_retry(milestones[TransactionMilestones::SERVER_CONNECT]))) {
+ (!t_state.pCongestionEntry->proxy_retry(milestones[TS_MILESTONE_SERVER_CONNECT]))) {
t_state.congestion_congested_or_failed = 1;
t_state.pCongestionEntry->stat_inc_F();
CONGEST_INCREMENT_DYN_STAT(congested_on_F_stat);
handleEvent(CONGESTION_EVENT_CONGESTED_ON_F, NULL);
return;
- } else if (t_state.pCongestionEntry->M_congested(ink_hrtime_to_sec(milestones[TransactionMilestones::SERVER_CONNECT]))) {
+ } else if (t_state.pCongestionEntry->M_congested(ink_hrtime_to_sec(milestones[TS_MILESTONE_SERVER_CONNECT]))) {
t_state.pCongestionEntry->stat_inc_M();
t_state.congestion_congested_or_failed = 1;
CONGEST_INCREMENT_DYN_STAT(congested_on_M_stat);
@@ -4861,7 +4861,7 @@ HttpSM::do_api_callout_internal()
break;
case HttpTransact::SM_ACTION_API_SEND_RESPONSE_HDR:
cur_hook_id = TS_HTTP_SEND_RESPONSE_HDR_HOOK;
- milestones[TransactionMilestones::UA_BEGIN_WRITE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_UA_BEGIN_WRITE] = Thread::get_hrtime();
break;
case HttpTransact::SM_ACTION_API_SM_SHUTDOWN:
if (callout_state == HTTP_API_IN_CALLOUT || callout_state == HTTP_API_DEFERED_SERVER_ERROR) {
@@ -5002,10 +5002,10 @@ HttpSM::mark_server_down_on_client_abort()
// the actual origin server is one that is hung //
/////////////////////////////////////////////////////
if (t_state.current.request_to == HttpTransact::ORIGIN_SERVER && t_state.hdr_info.request_content_length == 0) {
- if (milestones[TransactionMilestones::SERVER_FIRST_CONNECT] != 0 && milestones[TransactionMilestones::SERVER_FIRST_READ] == 0) {
+ if (milestones[TS_MILESTONE_SERVER_FIRST_CONNECT] != 0 && milestones[TS_MILESTONE_SERVER_FIRST_READ] == 0) {
// Check to see if client waited for the threshold
// to declare the origin server as down
- ink_hrtime wait = Thread::get_hrtime() - milestones[TransactionMilestones::SERVER_FIRST_CONNECT];
+ ink_hrtime wait = Thread::get_hrtime() - milestones[TS_MILESTONE_SERVER_FIRST_CONNECT];
if (wait < 0) {
wait = 0;
}
@@ -5693,7 +5693,7 @@ HttpSM::setup_server_send_request()
server_request_body_bytes = msg_len;
}
- milestones[TransactionMilestones::SERVER_BEGIN_WRITE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_BEGIN_WRITE] = Thread::get_hrtime();
server_entry->write_vio = server_entry->vc->do_io_write(this, hdr_length, buf_start);
}
@@ -5723,7 +5723,7 @@ HttpSM::setup_server_read_response_header()
t_state.hdr_info.server_response.create(HTTP_TYPE_RESPONSE);
http_parser_clear(&http_parser);
server_response_hdr_bytes = 0;
- milestones[TransactionMilestones::SERVER_READ_HEADER_DONE] = 0;
+ milestones[TS_MILESTONE_SERVER_READ_HEADER_DONE] = 0;
// We already done the READ when we setup the connection to
// read the request header
@@ -6357,7 +6357,7 @@ HttpSM::setup_blind_tunnel(bool send_response_hdr)
IOBufferReader *r_from = from_ua_buf->alloc_reader();
IOBufferReader *r_to = to_ua_buf->alloc_reader();
- milestones[TransactionMilestones::SERVER_BEGIN_WRITE] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SERVER_BEGIN_WRITE] = Thread::get_hrtime();
if (send_response_hdr) {
client_response_hdr_bytes = write_response_header_into_buffer(&t_state.hdr_info.client_response, to_ua_buf);
} else {
@@ -6599,7 +6599,7 @@ HttpSM::kill_this()
void
HttpSM::update_stats()
{
- milestones[TransactionMilestones::SM_FINISH] = Thread::get_hrtime();
+ milestones[TS_MILESTONE_SM_FINISH] = Thread::get_hrtime();
if (t_state.cop_test_page && !t_state.http_config_param->record_cop_page) {
DebugSM("http_seq", "Skipping cop heartbeat logging & stats due to config");
@@ -6628,29 +6628,29 @@ HttpSM::update_stats()
}
}
- ink_hrtime total_time = milestones.elapsed(TransactionMilestones::SM_START, TransactionMilestones::SM_FINISH);
+ ink_hrtime total_time = milestones.elapsed(TS_MILESTONE_SM_START, TS_MILESTONE_SM_FINISH);
// ua_close will not be assigned properly in some exceptional situation.
// TODO: Assign ua_close with suitable value when HttpTunnel terminates abnormally.
- if (milestones[TransactionMilestones::UA_CLOSE] == 0 && milestones[TransactionMilestones::UA_READ_HEADER_DONE] > 0)
- milestones[TransactionMilestones::UA_CLOSE] = Thread::get_hrtime();
+ if (milestones[TS_MILESTONE_UA_CLOSE] == 0 && milestones[TS_MILESTONE_UA_READ_HEADER_DONE] > 0)
+ milestones[TS_MILESTONE_UA_CLOSE] = Thread::get_hrtime();
// request_process_time = The time after the header is parsed to the completion of the transaction
ink_hrtime request_process_time =
- milestones[TransactionMilestones::UA_CLOSE] - milestones[TransactionMilestones::UA_READ_HEADER_DONE];
+ milestones[TS_MILESTONE_UA_CLOSE] - milestones[TS_MILESTONE_UA_READ_HEADER_DONE];
HttpTransact::client_result_stat(&t_state, total_time, request_process_time);
ink_hrtime ua_write_time;
- if (milestones[TransactionMilestones::UA_BEGIN_WRITE] != 0 && milestones[TransactionMilestones::UA_CLOSE] != 0) {
- ua_write_time = milestones.elapsed(TransactionMilestones::UA_BEGIN_WRITE, TransactionMilestones::UA_CLOSE);
+ if (milestones[TS_MILESTONE_UA_BEGIN_WRITE] != 0 && milestones[TS_MILESTONE_UA_CLOSE] != 0) {
+ ua_write_time = milestones.elapsed(TS_MILESTONE_UA_BEGIN_WRITE, TS_MILESTONE_UA_CLOSE);
} else {
ua_write_time = -1;
}
ink_hrtime os_read_time;
- if (milestones[TransactionMilestones::SERVER_READ_HEADER_DONE] != 0 && milestones[TransactionMilestones::SERVER_CLOSE] != 0) {
- os_read_time = milestones.elapsed(TransactionMilestones::SERVER_READ_HEADER_DONE, TransactionMilestones::SERVER_CLOSE);
+ if (milestones[TS_MILESTONE_SERVER_READ_HEADER_DONE] != 0 && milestones[TS_MILESTONE_SERVER_CLOSE] != 0) {
+ os_read_time = milestones.elapsed(TS_MILESTONE_SERVER_READ_HEADER_DONE, TS_MILESTONE_SERVER_CLOSE);
} else {
os_read_time = -1;
}
@@ -6731,21 +6731,21 @@ HttpSM::update_stats()
"plugin_total: %.3f",
sm_id, client_ip, t_state.client_info.src_addr.host_order_port(), url_string, status, unique_id_string,
redirection_tries, client_response_body_bytes, fd, t_state.client_info.state, t_state.server_info.state,
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::UA_BEGIN),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::UA_FIRST_READ),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::UA_READ_HEADER_DONE),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::CACHE_OPEN_READ_BEGIN),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::CACHE_OPEN_READ_END),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::DNS_LOOKUP_BEGIN),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::DNS_LOOKUP_END),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::SERVER_CONNECT),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::SERVER_FIRST_READ),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::SERVER_READ_HEADER_DONE),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::SERVER_CLOSE),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::UA_CLOSE),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::SM_FINISH),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::PLUGIN_ACTIVE),
- milestones.difference(TransactionMilestones::SM_START, TransactionMilestones::PLUGIN_TOTAL));
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_FIRST_READ),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_READ_HEADER_DONE),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_CACHE_OPEN_READ_BEGIN),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_CACHE_OPEN_READ_END),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_DNS_LOOKUP_BEGIN),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_DNS_LOOKUP_END),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CONNECT),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_FIRST_READ),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_READ_HEADER_DONE),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CLOSE),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_CLOSE),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_SM_FINISH),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_PLUGIN_ACTIVE),
+ milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_PLUGIN_TOTAL));
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 6c765b6..b685cf1 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -8868,83 +8868,83 @@ HttpTransact::update_size_and_time_stats(State *s, ink_hrtime total_time, ink_hr
// update milestones stats
if (http_ua_begin_time_stat) {
HTTP_SUM_TRANS_STAT(http_ua_begin_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::UA_BEGIN))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN))
}
if (http_ua_first_read_time_stat) {
HTTP_SUM_TRANS_STAT(http_ua_first_read_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::UA_FIRST_READ))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_FIRST_READ))
}
if (http_ua_read_header_done_time_stat) {
HTTP_SUM_TRANS_STAT(http_ua_read_header_done_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::UA_READ_HEADER_DONE))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_READ_HEADER_DONE))
}
if (http_ua_begin_write_time_stat) {
HTTP_SUM_TRANS_STAT(http_ua_begin_write_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::UA_BEGIN_WRITE))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN_WRITE))
}
if (http_ua_close_time_stat) {
HTTP_SUM_TRANS_STAT(http_ua_close_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::UA_CLOSE))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_CLOSE))
}
if (http_server_first_connect_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_first_connect_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_FIRST_CONNECT))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_FIRST_CONNECT))
}
if (http_server_connect_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_connect_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_CONNECT))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CONNECT))
}
if (http_server_connect_end_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_connect_end_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_CONNECT_END))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CONNECT_END))
}
if (http_server_begin_write_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_begin_write_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_BEGIN_WRITE))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_BEGIN_WRITE))
}
if (http_server_first_read_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_first_read_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_FIRST_READ))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_FIRST_READ))
}
if (http_server_read_header_done_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_read_header_done_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_READ_HEADER_DONE))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_READ_HEADER_DONE))
}
if (http_server_close_time_stat) {
HTTP_SUM_TRANS_STAT(http_server_close_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SERVER_CLOSE))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CLOSE))
}
if (http_cache_open_read_begin_time_stat) {
HTTP_SUM_TRANS_STAT(http_cache_open_read_begin_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::CACHE_OPEN_READ_BEGIN))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_CACHE_OPEN_READ_BEGIN))
}
if (http_cache_open_read_end_time_stat) {
HTTP_SUM_TRANS_STAT(http_cache_open_read_end_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::CACHE_OPEN_READ_END))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_CACHE_OPEN_READ_END))
}
if (http_cache_open_write_begin_time_stat) {
HTTP_SUM_TRANS_STAT(http_cache_open_write_begin_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::CACHE_OPEN_WRITE_BEGIN))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_CACHE_OPEN_WRITE_BEGIN))
}
if (http_cache_open_write_end_time_stat) {
HTTP_SUM_TRANS_STAT(http_cache_open_write_end_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::CACHE_OPEN_WRITE_END))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_CACHE_OPEN_WRITE_END))
}
if (http_dns_lookup_begin_time_stat) {
HTTP_SUM_TRANS_STAT(http_dns_lookup_begin_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::DNS_LOOKUP_BEGIN))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_DNS_LOOKUP_BEGIN))
}
if (http_dns_lookup_end_time_stat) {
HTTP_SUM_TRANS_STAT(http_dns_lookup_end_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::DNS_LOOKUP_END))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_DNS_LOOKUP_END))
}
if (http_sm_start_time_stat) {
HTTP_SUM_TRANS_STAT(http_sm_start_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SM_START))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SM_START))
}
if (http_sm_finish_time_stat) {
HTTP_SUM_TRANS_STAT(http_sm_finish_time_stat,
- milestones.difference_msec(TransactionMilestones::SM_START, TransactionMilestones::SM_FINISH))
+ milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SM_FINISH))
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 96373f2..482d01d 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -320,7 +320,7 @@ Log::init_fields()
//
// Initializes material to find a milestone name from their
// name in a rapid manner.
- field->init_milestone_container();
+ LogField::init_milestone_container();
//
// Create a hash table that will be used to find the global field
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/LogAccess.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index d20ee90..24fa519 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -674,7 +674,7 @@ LogAccess::marshal_config_str_var(char *config_var, char *buf)
-------------------------------------------------------------------------*/
int
-LogAccess::marshal_milestone(TransactionMilestones::Milestone ms, char *buf)
+LogAccess::marshal_milestone(TSMilestonesType ms, char *buf)
{
DEFAULT_INT_FIELD;
}
@@ -683,7 +683,7 @@ LogAccess::marshal_milestone(TransactionMilestones::Milestone ms, char *buf)
-------------------------------------------------------------------------*/
int
-LogAccess::marshal_milestone_diff(TransactionMilestones::Milestone ms1, TransactionMilestones::Milestone ms2, char *buf)
+LogAccess::marshal_milestone_diff(TSMilestonesType ms1, TSMilestonesType ms2, char *buf)
{
DEFAULT_INT_FIELD;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/LogAccess.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index afd44f5..98f8271 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -287,8 +287,8 @@ public:
//
// milestones access
//
- inkcoreapi virtual int marshal_milestone(TransactionMilestones::Milestone ms, char *buf);
- inkcoreapi virtual int marshal_milestone_diff(TransactionMilestones::Milestone ms1, TransactionMilestones::Milestone ms2,
+ inkcoreapi virtual int marshal_milestone(TSMilestonesType ms, char *buf);
+ inkcoreapi virtual int marshal_milestone_diff(TSMilestonesType ms1, TSMilestonesType ms2,
char *buf);
//
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/LogAccessHttp.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index 4d97357..08e7b66 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -1000,7 +1000,7 @@ LogAccessHttp::marshal_server_resp_time_ms(char *buf)
{
if (buf) {
ink_hrtime elapsed =
- m_http_sm->milestones[TransactionMilestones::SERVER_CLOSE] - m_http_sm->milestones[TransactionMilestones::SERVER_CONNECT];
+ m_http_sm->milestones[TS_MILESTONE_SERVER_CLOSE] - m_http_sm->milestones[TS_MILESTONE_SERVER_CONNECT];
int64_t val = (int64_t)ink_hrtime_to_msec(elapsed);
marshal_int(buf, val);
}
@@ -1012,7 +1012,7 @@ LogAccessHttp::marshal_server_resp_time_s(char *buf)
{
if (buf) {
ink_hrtime elapsed =
- m_http_sm->milestones[TransactionMilestones::SERVER_CLOSE] - m_http_sm->milestones[TransactionMilestones::SERVER_CONNECT];
+ m_http_sm->milestones[TS_MILESTONE_SERVER_CLOSE] - m_http_sm->milestones[TS_MILESTONE_SERVER_CONNECT];
int64_t val = (int64_t)ink_hrtime_to_sec(elapsed);
marshal_int(buf, val);
}
@@ -1161,7 +1161,7 @@ LogAccessHttp::marshal_transfer_time_ms(char *buf)
{
if (buf) {
ink_hrtime elapsed =
- m_http_sm->milestones[TransactionMilestones::SM_FINISH] - m_http_sm->milestones[TransactionMilestones::SM_START];
+ m_http_sm->milestones[TS_MILESTONE_SM_FINISH] - m_http_sm->milestones[TS_MILESTONE_SM_START];
int64_t val = (int64_t)ink_hrtime_to_msec(elapsed);
marshal_int(buf, val);
}
@@ -1173,7 +1173,7 @@ LogAccessHttp::marshal_transfer_time_s(char *buf)
{
if (buf) {
ink_hrtime elapsed =
- m_http_sm->milestones[TransactionMilestones::SM_FINISH] - m_http_sm->milestones[TransactionMilestones::SM_START];
+ m_http_sm->milestones[TS_MILESTONE_SM_FINISH] - m_http_sm->milestones[TS_MILESTONE_SM_START];
int64_t val = (int64_t)ink_hrtime_to_sec(elapsed);
marshal_int(buf, val);
}
@@ -1421,7 +1421,7 @@ LogAccessHttp::marshal_http_header_field_escapify(LogField::Container container,
int
-LogAccessHttp::marshal_milestone(TransactionMilestones::Milestone ms, char *buf)
+LogAccessHttp::marshal_milestone(TSMilestonesType ms, char *buf)
{
if (buf) {
int64_t val = ink_hrtime_to_msec(m_http_sm->milestones[ms]);
@@ -1432,7 +1432,7 @@ LogAccessHttp::marshal_milestone(TransactionMilestones::Milestone ms, char *buf)
int
-LogAccessHttp::marshal_milestone_diff(TransactionMilestones::Milestone ms1, TransactionMilestones::Milestone ms2, char *buf)
+LogAccessHttp::marshal_milestone_diff(TSMilestonesType ms1, TSMilestonesType ms2, char *buf)
{
if (buf) {
ink_hrtime elapsed = m_http_sm->milestones.elapsed(ms2, ms1);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/LogAccessHttp.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccessHttp.h b/proxy/logging/LogAccessHttp.h
index fdaecd0..966f4b7 100644
--- a/proxy/logging/LogAccessHttp.h
+++ b/proxy/logging/LogAccessHttp.h
@@ -144,8 +144,8 @@ public:
virtual int marshal_http_header_field(LogField::Container container, char *field, char *buf);
virtual int marshal_http_header_field_escapify(LogField::Container container, char *field, char *buf);
- virtual int marshal_milestone(TransactionMilestones::Milestone ms, char *buf);
- virtual int marshal_milestone_diff(TransactionMilestones::Milestone ms1, TransactionMilestones::Milestone ms2, char *buf);
+ virtual int marshal_milestone(TSMilestonesType ms, char *buf);
+ virtual int marshal_milestone_diff(TSMilestonesType ms1, TSMilestonesType ms2, char *buf);
virtual void set_client_req_url(char *, int); // STR
virtual void set_client_req_url_canon(char *, int); // STR
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/LogField.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogField.cc b/proxy/logging/LogField.cc
index d99ab54..f7be444 100644
--- a/proxy/logging/LogField.cc
+++ b/proxy/logging/LogField.cc
@@ -123,37 +123,37 @@ struct cmp_str {
bool operator()(ts::ConstBuffer a, ts::ConstBuffer b) { return memcmp(a._ptr, b._ptr, MAX(a._size, b._size)) < 0; }
};
-typedef std::map<ts::ConstBuffer, TransactionMilestones::Milestone, cmp_str> milestone_map;
+typedef std::map<ts::ConstBuffer, TSMilestonesType, cmp_str> milestone_map;
static milestone_map m_milestone_map;
struct milestone {
const char *msname;
- TransactionMilestones::Milestone mstype;
+ TSMilestonesType mstype;
};
static const milestone milestones[] = {
- {"TS_MILESTONE_UA_BEGIN", TransactionMilestones::UA_BEGIN},
- {"TS_MILESTONE_UA_FIRST_READ", TransactionMilestones::UA_FIRST_READ},
- {"TS_MILESTONE_UA_READ_HEADER_DONE", TransactionMilestones::UA_READ_HEADER_DONE},
- {"TS_MILESTONE_UA_BEGIN_WRITE", TransactionMilestones::UA_BEGIN_WRITE},
- {"TS_MILESTONE_UA_CLOSE", TransactionMilestones::UA_CLOSE},
- {"TS_MILESTONE_SERVER_FIRST_CONNECT", TransactionMilestones::SERVER_FIRST_CONNECT},
- {"TS_MILESTONE_SERVER_CONNECT", TransactionMilestones::SERVER_CONNECT},
- {"TS_MILESTONE_SERVER_CONNECT_END", TransactionMilestones::SERVER_CONNECT_END},
- {"TS_MILESTONE_SERVER_BEGIN_WRITE", TransactionMilestones::SERVER_BEGIN_WRITE},
- {"TS_MILESTONE_SERVER_FIRST_READ", TransactionMilestones::SERVER_FIRST_READ},
- {"TS_MILESTONE_SERVER_READ_HEADER_DONE", TransactionMilestones::SERVER_READ_HEADER_DONE},
- {"TS_MILESTONE_SERVER_CLOSE", TransactionMilestones::SERVER_CLOSE},
- {"TS_MILESTONE_CACHE_OPEN_READ_BEGIN", TransactionMilestones::CACHE_OPEN_READ_BEGIN},
- {"TS_MILESTONE_CACHE_OPEN_READ_END", TransactionMilestones::CACHE_OPEN_READ_END},
- {"TS_MILESTONE_CACHE_OPEN_WRITE_BEGIN", TransactionMilestones::CACHE_OPEN_WRITE_BEGIN},
- {"TS_MILESTONE_CACHE_OPEN_WRITE_END", TransactionMilestones::CACHE_OPEN_WRITE_END},
- {"TS_MILESTONE_DNS_LOOKUP_BEGIN", TransactionMilestones::DNS_LOOKUP_BEGIN},
- {"TS_MILESTONE_DNS_LOOKUP_END", TransactionMilestones::DNS_LOOKUP_END},
- {"TS_MILESTONE_SM_START", TransactionMilestones::SM_START},
- {"TS_MILESTONE_SM_FINISH", TransactionMilestones::SM_FINISH},
- {"TS_MILESTONE_PLUGIN_ACTIVE", TransactionMilestones::PLUGIN_ACTIVE},
- {"TS_MILESTONE_PLUGIN_TOTAL", TransactionMilestones::PLUGIN_TOTAL},
+ {"TS_MILESTONE_UA_BEGIN", TS_MILESTONE_UA_BEGIN},
+ {"TS_MILESTONE_UA_FIRST_READ", TS_MILESTONE_UA_FIRST_READ},
+ {"TS_MILESTONE_UA_READ_HEADER_DONE", TS_MILESTONE_UA_READ_HEADER_DONE},
+ {"TS_MILESTONE_UA_BEGIN_WRITE", TS_MILESTONE_UA_BEGIN_WRITE},
+ {"TS_MILESTONE_UA_CLOSE", TS_MILESTONE_UA_CLOSE},
+ {"TS_MILESTONE_SERVER_FIRST_CONNECT", TS_MILESTONE_SERVER_FIRST_CONNECT},
+ {"TS_MILESTONE_SERVER_CONNECT", TS_MILESTONE_SERVER_CONNECT},
+ {"TS_MILESTONE_SERVER_CONNECT_END", TS_MILESTONE_SERVER_CONNECT_END},
+ {"TS_MILESTONE_SERVER_BEGIN_WRITE", TS_MILESTONE_SERVER_BEGIN_WRITE},
+ {"TS_MILESTONE_SERVER_FIRST_READ", TS_MILESTONE_SERVER_FIRST_READ},
+ {"TS_MILESTONE_SERVER_READ_HEADER_DONE", TS_MILESTONE_SERVER_READ_HEADER_DONE},
+ {"TS_MILESTONE_SERVER_CLOSE", TS_MILESTONE_SERVER_CLOSE},
+ {"TS_MILESTONE_CACHE_OPEN_READ_BEGIN", TS_MILESTONE_CACHE_OPEN_READ_BEGIN},
+ {"TS_MILESTONE_CACHE_OPEN_READ_END", TS_MILESTONE_CACHE_OPEN_READ_END},
+ {"TS_MILESTONE_CACHE_OPEN_WRITE_BEGIN", TS_MILESTONE_CACHE_OPEN_WRITE_BEGIN},
+ {"TS_MILESTONE_CACHE_OPEN_WRITE_END", TS_MILESTONE_CACHE_OPEN_WRITE_END},
+ {"TS_MILESTONE_DNS_LOOKUP_BEGIN", TS_MILESTONE_DNS_LOOKUP_BEGIN},
+ {"TS_MILESTONE_DNS_LOOKUP_END", TS_MILESTONE_DNS_LOOKUP_END},
+ {"TS_MILESTONE_SM_START", TS_MILESTONE_SM_START},
+ {"TS_MILESTONE_SM_FINISH", TS_MILESTONE_SM_FINISH},
+ {"TS_MILESTONE_PLUGIN_ACTIVE", TS_MILESTONE_PLUGIN_ACTIVE},
+ {"TS_MILESTONE_PLUGIN_TOTAL", TS_MILESTONE_PLUGIN_TOTAL},
};
void
@@ -171,7 +171,7 @@ LogField::init_milestone_container(void)
LogField::LogField(const char *name, const char *symbol, Type type, MarshalFunc marshal, UnmarshalFunc unmarshal, SetFunc _setfunc)
: m_name(ats_strdup(name)), m_symbol(ats_strdup(symbol)), m_type(type), m_container(NO_CONTAINER), m_marshal_func(marshal),
m_unmarshal_func(unmarshal), m_unmarshal_func_map(NULL), m_agg_op(NO_AGGREGATE), m_agg_cnt(0), m_agg_val(0),
- m_milestone1(TransactionMilestones::LAST_ENTRY), m_milestone2(TransactionMilestones::LAST_ENTRY), m_time_field(false),
+ m_milestone1(TS_MILESTONE_LAST_ENTRY), m_milestone2(TS_MILESTONE_LAST_ENTRY), m_time_field(false),
m_alias_map(0), m_set_func(_setfunc)
{
ink_assert(m_name != NULL);
@@ -187,7 +187,7 @@ LogField::LogField(const char *name, const char *symbol, Type type, MarshalFunc
Ptr<LogFieldAliasMap> map, SetFunc _setfunc)
: m_name(ats_strdup(name)), m_symbol(ats_strdup(symbol)), m_type(type), m_container(NO_CONTAINER), m_marshal_func(marshal),
m_unmarshal_func(NULL), m_unmarshal_func_map(unmarshal), m_agg_op(NO_AGGREGATE), m_agg_cnt(0), m_agg_val(0),
- m_milestone1(TransactionMilestones::LAST_ENTRY), m_milestone2(TransactionMilestones::LAST_ENTRY), m_time_field(false),
+ m_milestone1(TS_MILESTONE_LAST_ENTRY), m_milestone2(TS_MILESTONE_LAST_ENTRY), m_time_field(false),
m_alias_map(map), m_set_func(_setfunc)
{
ink_assert(m_name != NULL);
@@ -200,11 +200,11 @@ LogField::LogField(const char *name, const char *symbol, Type type, MarshalFunc
strcmp(m_symbol, "cqtn") == 0 || strcmp(m_symbol, "cqtd") == 0 || strcmp(m_symbol, "cqtt") == 0);
}
-TransactionMilestones::Milestone
+TSMilestonesType
LogField::milestone_from_m_name()
{
milestone_map::iterator it;
- TransactionMilestones::Milestone result = TransactionMilestones::LAST_ENTRY;
+ TSMilestonesType result = TS_MILESTONE_LAST_ENTRY;
it = m_milestone_map.find(ts::ConstBuffer(m_name, strlen(m_name)));
if (it != m_milestone_map.end())
@@ -214,7 +214,7 @@ LogField::milestone_from_m_name()
}
int
-LogField::milestones_from_m_name(TransactionMilestones::Milestone *ms1, TransactionMilestones::Milestone *ms2)
+LogField::milestones_from_m_name(TSMilestonesType *ms1, TSMilestonesType *ms2)
{
milestone_map::iterator it;
ts::ConstBuffer ms1_name, ms2_name(m_name, strlen(m_name));
@@ -242,7 +242,7 @@ LogField::milestones_from_m_name(TransactionMilestones::Milestone *ms1, Transact
LogField::LogField(const char *field, Container container, SetFunc _setfunc)
: m_name(ats_strdup(field)), m_symbol(ats_strdup(container_names[container])), m_type(LogField::STRING), m_container(container),
m_marshal_func(NULL), m_unmarshal_func(NULL), m_unmarshal_func_map(NULL), m_agg_op(NO_AGGREGATE), m_agg_cnt(0), m_agg_val(0),
- m_milestone1(TransactionMilestones::LAST_ENTRY), m_milestone2(TransactionMilestones::LAST_ENTRY), m_time_field(false),
+ m_milestone1(TS_MILESTONE_LAST_ENTRY), m_milestone2(TS_MILESTONE_LAST_ENTRY), m_time_field(false),
m_alias_map(0), m_set_func(_setfunc)
{
ink_assert(m_name != NULL);
@@ -277,7 +277,7 @@ LogField::LogField(const char *field, Container container, SetFunc _setfunc)
case MS:
m_milestone1 = milestone_from_m_name();
- if (TransactionMilestones::LAST_ENTRY == m_milestone1)
+ if (TS_MILESTONE_LAST_ENTRY == m_milestone1)
Note("Invalid milestone name in LogField ctor: %s", m_name);
m_unmarshal_func = &(LogAccess::unmarshal_int_to_str);
break;
@@ -299,8 +299,8 @@ LogField::LogField(const char *field, Container container, SetFunc _setfunc)
LogField::LogField(const LogField &rhs)
: m_name(ats_strdup(rhs.m_name)), m_symbol(ats_strdup(rhs.m_symbol)), m_type(rhs.m_type), m_container(rhs.m_container),
m_marshal_func(rhs.m_marshal_func), m_unmarshal_func(rhs.m_unmarshal_func), m_unmarshal_func_map(rhs.m_unmarshal_func_map),
- m_agg_op(rhs.m_agg_op), m_agg_cnt(0), m_agg_val(0), m_milestone1(TransactionMilestones::LAST_ENTRY),
- m_milestone2(TransactionMilestones::LAST_ENTRY), m_time_field(rhs.m_time_field), m_alias_map(rhs.m_alias_map),
+ m_agg_op(rhs.m_agg_op), m_agg_cnt(0), m_agg_val(0), m_milestone1(TS_MILESTONE_LAST_ENTRY),
+ m_milestone2(TS_MILESTONE_LAST_ENTRY), m_time_field(rhs.m_time_field), m_alias_map(rhs.m_alias_map),
m_set_func(rhs.m_set_func)
{
ink_assert(m_name != NULL);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/82b09e0b/proxy/logging/LogField.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogField.h b/proxy/logging/LogField.h
index eea38d8..29ab7a9 100644
--- a/proxy/logging/LogField.h
+++ b/proxy/logging/LogField.h
@@ -186,13 +186,13 @@ private:
Aggregate m_agg_op;
int64_t m_agg_cnt;
int64_t m_agg_val;
- TransactionMilestones::Milestone m_milestone1; ///< Used for MS and MSDMS as the first (or only) milestone.
- TransactionMilestones::Milestone m_milestone2; ///< Second milestone for MSDMS
+ TSMilestonesType m_milestone1; ///< Used for MS and MSDMS as the first (or only) milestone.
+ TSMilestonesType m_milestone2; ///< Second milestone for MSDMS
bool m_time_field;
Ptr<LogFieldAliasMap> m_alias_map; // map sINT <--> string
SetFunc m_set_func;
- TransactionMilestones::Milestone milestone_from_m_name();
- int milestones_from_m_name(TransactionMilestones::Milestone *m1, TransactionMilestones::Milestone *m2);
+ TSMilestonesType milestone_from_m_name();
+ int milestones_from_m_name(TSMilestonesType *m1, TSMilestonesType *m2);
public:
LINK(LogField, link);