MCPcopy Create free account
hub / github.com/apache/trafficserver / ts_lua_http_milestone_get

Function ts_lua_http_milestone_get

plugins/lua/ts_lua_http_milestone.cc:97–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static int
98ts_lua_http_milestone_get(lua_State *L)
99{
100 int milestone_type;
101 TSHRTime value;
102 TSHRTime epoch;
103 ts_lua_http_ctx *http_ctx;
104
105 GET_HTTP_CONTEXT(http_ctx, L);
106
107 milestone_type = luaL_checkinteger(L, 1);
108
109 if (TS_SUCCESS == TSHttpTxnMilestoneGet(http_ctx->txnp, TS_MILESTONE_SM_START, &epoch)) {
110 if (TS_SUCCESS == TSHttpTxnMilestoneGet(http_ctx->txnp, TSMilestonesType(milestone_type), &value)) {
111 lua_pushnumber(L, (double)(value - epoch) / 1000000000);
112 return 1;
113 }
114 }
115
116 return 0;
117}

Callers

nothing calls this directly

Calls 1

TSHttpTxnMilestoneGetFunction · 0.85

Tested by

no test coverage detected