TSHTTPTXNMILESTONEGET(3ts)
π TSHTTPTXNMILESTONEGET β Apache Traffic Server manual, section 3ts
okay bestie, gather round, because today we're reading the TSHttpTxnMilestoneGet page from the Apache Traffic Server 3ts manual and honestly? it's giving stopwatch energy and i'm obsessed. π
β¨ NAME β¨
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 β¨
so TSHttpTxnMilestoneGet() literally fetches one specific milestone timer value for the transaction txnp. these timers get calculated over the whole life of a transaction, and they're measured in nanoseconds counting from the beginning of that transaction. time is a pointer to storage that gets updated if the call succeeds. no cap. π«
enum TSMilestonesType
an enumeration of the valid indices of transaction milestone data. here's the whole roster, every single one, no skipping: π
TS_MILESTONE_SM_STARTβ the transaction state machine is initialized.TS_MILESTONE_UA_BEGINβ the client connection is accepted.TS_MILESTONE_UA_READ_HEADER_DONEβ the request header from the client has been read and parsed.TS_MILESTONE_CACHE_OPEN_READ_BEGINβ initiate read of the cache.TS_MILESTONE_CACHE_OPEN_READ_ENDβ initial cache read has resolved.TS_MILESTONE_CACHE_OPEN_WRITE_BEGINβ start open for cache write.TS_MILESTONE_CACHE_OPEN_WRITE_ENDβ cache has been opened for write.TS_MILESTONE_DNS_LOOKUP_BEGINβ initiate host resolution in HostDB.TS_MILESTONE_DNS_LOOKUP_ENDβ host resolution resolves.TS_MILESTONE_SERVER_FIRST_CONNECTβ first time origin server connect attempted or shared session attached.TS_MILESTONE_SERVER_CONNECTβ most recent time origin server connect attempted or shared session attached.TS_MILESTONE_SERVER_CONNECT_ENDβ more recent time a connection attempt was resolved.TS_MILESTONE_SERVER_BEGIN_WRITEβ first byte is written to the origin server connection.TS_MILESTONE_SERVER_FIRST_READβ first byte is read from connection to origin server.TS_MILESTONE_SERVER_READ_HEADER_DONEβ origin server response has been read and parsed.TS_MILESTONE_UA_BEGIN_WRITEβ the response header write to the client starts.TS_MILESTONE_SERVER_CLOSEβ last I/O activity on origin server connection.TS_MILESTONE_UA_CLOSEβ last I/O activity on the client socket, or connection abort.TS_MILESTONE_SM_FINISHβ transaction has finished, state machine final logging has started.TS_MILESTONE_PLUGIN_ACTIVEβ amount of time plugins were active (running plugin code).TS_MILESTONE_PLUGIN_TOTALβ amount of time spent in or waiting for plugins.TS_MILESTONE_TLS_HANDSHAKE_STARTβ timestamp when the server starts the TLS handshake.0if no handshake is performed (connection reuse).TS_MILESTONE_TLS_HANDSHAKE_ENDβ timestamp when the server completes the TLS handshake.0if no handshake is performed (connection reuse).TS_MILESTONE_LAST_ENTRYβ a pseudo index which is set to be one more than the last valid index. this is useful for looping over the data.
and now the lore, the fine print, the stuff you absolutely cannot skip: π
- 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_ACTIVE value is the amount of time the plugin was active, that is performing computation. TS_MILESTONE_PLUGIN_TOTAL is 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 in TS_MILESTONE_PLUGIN_TOTAL but not in TS_MILESTONE_PLUGIN_ACTIVE. π§ β¨
β¨ RETURN VALUES β¨
TS_SUCCESS if successful and time was updated, otherwise TS_ERROR. that's it, that's the whole vibe check. π
β¨ SEE ALSO β¨
β¨ COPYRIGHT β¨
2026, dev@trafficserver.apache.org
and that's the page bestie, we ate and left no crumbs π«Ά this was Apache Traffic Server 9.2, dated Feb 12, 2026, and you're officially a milestones girlie now. go forth and timestamp things ππΈπ¦
π¦ where this page comes from
- ubuntu noble: trafficserver-dev 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms