From 3de8b69f1cea1bbfdc29dceb4ca1991d583dcc74 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 9 Dec 2020 13:54:21 +0000 Subject: net.http: track time of request for debug/stats purposes --- net/http.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/http.lua b/net/http.lua index bb247d18..3481389a 100644 --- a/net/http.lua +++ b/net/http.lua @@ -24,6 +24,7 @@ local t_insert, t_concat = table.insert, table.concat; local pairs = pairs; local tonumber, tostring, traceback = tonumber, tostring, debug.traceback; +local os_time = os.time; local xpcall = require "util.xpcall".xpcall; local error = error @@ -221,6 +222,7 @@ local function request(self, u, ex, callback) req.url = u; req.http = self; + req.time = os_time(); if not req.path then req.path = "/"; -- cgit v1.2.3