TSHttpTxnMilestoneGet
Get a specified milestone timer value for the current transaction.
Synopsis
include <ts/ts.h>
TSReturnCode TSHttpTxnMilestoneGet(TSHttpTxn txnp, TSMilestonesType milestone, TSHRTime * time)
Description
TSHttpTxnMilestoneGet() will fetch a specific milestone timer value for the transaction txnp. These timers are calculated during the lifetime of a transaction and are measured in nanoseconds from the beginning of the transaction. time is used a pointer to storage to update if the call is successful.
TSMilestonesType
An enumeration of the valid indices of transaction milestone data.
TS_MILESTONE_SM_STARTTransaction state machine is initialized.
TS_MILESTONE_UA_BEGINThe client connection is accepted.
TS_MILESTONE_UA_READ_HEADER_DONEThe request header from the client has been read and parsed.
TS_MILESTONE_CACHE_OPEN_READ_BEGINInitiate read of the cache.
TS_MILESTONE_CACHE_OPEN_READ_ENDInitial cache read has resolved.
TS_MILESTONE_CACHE_OPEN_WRITE_BEGINStart open for cache write.
TS_MILESTONE_CACHE_OPEN_WRITE_ENDCache has been opened for write.
TS_MILESTONE_DNS_LOOKUP_BEGINInitiate host resolution in HostDB
TS_MILESTONE_DNS_LOOKUP_ENDHost resolution resolves.
TS_MILESTONE_SERVER_FIRST_CONNECTFirst time origin server connect attempted or shared shared session attached.
TS_MILESTONE_SERVER_CONNECTMost recent time origin server connect attempted or shared session attached.
TS_MILESTONE_SERVER_CONNECT_ENDMore recent time a connection attempt was resolved.
TS_MILESTONE_SERVER_BEGIN_WRITEFirst byte is written to the origin server connection.
TS_MILESTONE_SERVER_FIRST_READFirst byte is read from connection to origin server.
TS_MILESTONE_SERVER_READ_HEADER_DONEOrigin server response has been read and parsed.
TS_MILESTONE_UA_BEGIN_WRITEThe response header write to the client starts.
TS_MILESTONE_SERVER_CLOSELast I/O activity on origin server connection.
TS_MILESTONE_UA_CLOSELast I/O activity on the client socket, or connection abort.
TS_MILESTONE_SM_FINISHTransaction has finished, state machine final logging has started.
TS_MILESTONE_PLUGIN_ACTIVEAmount of time plugins were active (running plugin code).
TS_MILESTONE_PLUGIN_TOTALAmount of time spent in or waiting for plugins.
TS_MILESTONE_TLS_HANDSHAKE_STARTTimestamp when the server starts the TLS handshake. 0 if no handshake is performed (connection reuse).
TS_MILESTONE_TLS_HANDSHAKE_ENDTimestamp when the server completes the TLS handshake. 0 if no handshake is performed (connection reuse).
TS_MILESTONE_LAST_ENTRYA psuedo index which is set to be one more than the last valid index. This is useful for looping over the data.
The server connect times predate the transmission of the
SYNpacket. That is, before a connection to the origin server is completed.A connection attempt is resolved when no more connection related activity remains to be done, and the connection is either established or has failed.
TS_MILESTONE_UA_CLOSEandTS_MILESTONE_SERVER_CLOSEare updated continuously during the life of the transaction, every time there is I/O activity. The updating stops when the corresponding connection is closed, leaving the last I/O time as the final value.The cache
OPENmilestones time only the initial setup, the open, not the full read or write.TS_MILESTONE_PLUGIN_ACTIVEandTS_MILESTONE_PLUGIN_TOTALare different from the other milestones as they measure elapsed time, not event time. The value is the elapsed time plusTS_MILESTONE_SM_START. This was decided to be more convenient because then these milestones can be handled / displayed in the same way as the other milestones, as offsets fromTS_MILESTONE_SM_START.TS_MILESTONE_PLUGIN_ACTIVEvalue is the amount of time the plugin was active, that is performing computation.TS_MILESTONE_PLUGIN_TOTALis the wall time which includes any time the transaction was blocked while a plugin was active. For instance if a plugin waits on an external event, that waiting time will be inTS_MILESTONE_PLUGIN_TOTALbut not inTS_MILESTONE_PLUGIN_ACTIVE.
Return Values
TS_SUCCESS if successful and time was updated, otherwise TS_ERROR.
See Also
TSAPI(3ts)
