| 95 | } |
| 96 | |
| 97 | static int |
| 98 | ts_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 | } |
nothing calls this directly
no test coverage detected