---
name: "TSHttpTxnMilestoneGet"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSHttpTxnMilestoneGet"
---

# TSHttpTxnMilestoneGet(3ts)

get a specified milestone timer value for the current transaction

## 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

*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.

- **enum TSMilestonesType**

  An enumeration of the valid indices of transaction milestone data.

  - **enumerator TS\_MILESTONE\_SM\_START**

    Transaction state machine is initialized.

  - **enumerator TS\_MILESTONE\_UA\_BEGIN**

    The client connection is accepted.

  - **enumerator TS\_MILESTONE\_UA\_READ\_HEADER\_DONE**

    The request header from the client has been read and parsed.

  - **enumerator TS\_MILESTONE\_CACHE\_OPEN\_READ\_BEGIN**

    Initiate read of the cache.

  - **enumerator TS\_MILESTONE\_CACHE\_OPEN\_READ\_END**

    Initial cache read has resolved.

  - **enumerator TS\_MILESTONE\_CACHE\_OPEN\_WRITE\_BEGIN**

    Start open for cache write.

  - **enumerator TS\_MILESTONE\_CACHE\_OPEN\_WRITE\_END**

    Cache has been opened for write.

  - **enumerator TS\_MILESTONE\_DNS\_LOOKUP\_BEGIN**

    Initiate host resolution in HostDB

  - **enumerator TS\_MILESTONE\_DNS\_LOOKUP\_END**

    Host resolution resolves.

  - **enumerator TS\_MILESTONE\_SERVER\_FIRST\_CONNECT**

    First time origin server connect attempted or shared session attached.

  - **enumerator TS\_MILESTONE\_SERVER\_CONNECT**

    Most recent time origin server connect attempted or shared session attached.

  - **enumerator TS\_MILESTONE\_SERVER\_CONNECT\_END**

    More recent time a connection attempt was resolved.

  - **enumerator TS\_MILESTONE\_SERVER\_BEGIN\_WRITE**

    First byte is written to the origin server connection.

  - **enumerator TS\_MILESTONE\_SERVER\_FIRST\_READ**

    First byte is read from connection to origin server.

  - **enumerator TS\_MILESTONE\_SERVER\_READ\_HEADER\_DONE**

    Origin server response has been read and parsed.

  - **enumerator TS\_MILESTONE\_UA\_BEGIN\_WRITE**

    The response header write to the client starts.

  - **enumerator TS\_MILESTONE\_SERVER\_CLOSE**

    Last I/O activity on origin server connection.

  - **enumerator TS\_MILESTONE\_UA\_CLOSE**

    Last I/O activity on the client socket, or connection abort.

  - **enumerator TS\_MILESTONE\_SM\_FINISH**

    Transaction has finished, state machine final logging has started.

  - **enumerator TS\_MILESTONE\_PLUGIN\_ACTIVE**

    Amount of time plugins were active (running plugin code).

  - **enumerator TS\_MILESTONE\_PLUGIN\_TOTAL**

    Amount of time spent in or waiting for plugins.

  - **enumerator TS\_MILESTONE\_TLS\_HANDSHAKE\_START**

    Timestamp when the server starts the TLS handshake. 0 if no handshake is performed (connection reuse).

  - **enumerator TS\_MILESTONE\_TLS\_HANDSHAKE\_END**

    Timestamp when the server completes the TLS handshake. 0 if no handshake is performed (connection reuse).

  - **enumerator 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.

- •

  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*.

## SEE ALSO

**[TSAPI(3ts)](/TSAPI/3ts.md)**

## COPYRIGHT

2026, dev@trafficserver.apache.org
