TSHTTPTXNMILESTONEGET(3ts)

πŸ“¦
version 9.2.5 Β· 4 versions
, in ubuntu noble, ubuntu questing

πŸ’… 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. 0 if no handshake is performed (connection reuse).
  • TS_MILESTONE_TLS_HANDSHAKE_END β€” timestamp when the server completes the TLS handshake. 0 if 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 SYN packet. 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_CLOSE and TS_MILESTONE_SERVER_CLOSE are 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 OPEN milestones time only the initial setup, the open, not the full read or write.
  • TS_MILESTONE_PLUGIN_ACTIVE and TS_MILESTONE_PLUGIN_TOTAL are different from the other milestones as they measure elapsed time, not event time. the value is the elapsed time plus TS_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 from TS_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 ✨

TSAPI(3ts)


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