File: TSHttpTxnMilestoneGet.en.rst

package info (click to toggle)
trafficserver 9.2.5%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 53,008 kB
  • sloc: cpp: 345,484; ansic: 31,134; python: 24,200; sh: 7,271; makefile: 3,045; perl: 2,261; java: 277; pascal: 119; sql: 94; xml: 2
file content (179 lines) | stat: -rw-r--r-- 6,014 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
.. Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.

.. include:: ../../../common.defs

.. default-domain:: c

TSHttpTxnMilestoneGet
*********************

Get a specified :arg:`milestone` timer value for the current transaction.

Synopsis
========

.. code-block:: cpp

    #include <ts/ts.h>

.. function:: TSReturnCode TSHttpTxnMilestoneGet(TSHttpTxn txnp, TSMilestonesType milestone, TSHRTime * time)

Description
===========

:func:`TSHttpTxnMilestoneGet` will fetch a specific :arg:`milestone` timer
value for the transaction :arg:`txnp`. These timers are calculated during the
lifetime of a transaction and are measured in nanoseconds from the beginning of
the transaction. :arg:`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 :literal:`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.

*  :macro:`TS_MILESTONE_UA_CLOSE` and :macro:`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 :literal:`OPEN` milestones time only the initial setup, the
   *open*, not the full read or write.

*  :macro:`TS_MILESTONE_PLUGIN_ACTIVE` and :macro:`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* :macro:`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 :macro:`TS_MILESTONE_SM_START`.

   :macro:`TS_MILESTONE_PLUGIN_ACTIVE` value is the amount of time the plugin was active, that is performing
   computation. :macro:`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
   :macro:`TS_MILESTONE_PLUGIN_TOTAL` but not in :macro:`TS_MILESTONE_PLUGIN_ACTIVE`.

Return Values
=============

:macro:`TS_SUCCESS` if successful and :arg:`time` was updated, otherwise
:macro:`TS_ERROR`.

See Also
========

:manpage:`TSAPI(3ts)`