Changeset

11220:9b25eecde9e6

net.http: track time of request for debug/stats purposes
author Matthew Wild <mwild1@gmail.com>
date Wed, 09 Dec 2020 13:54:21 +0000
parents 11219:586a6ed6b0a6
children 11221:b0a563716334
files net/http.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/http.lua	Tue Dec 08 20:35:53 2020 +0100
+++ b/net/http.lua	Wed Dec 09 13:54:21 2020 +0000
@@ -24,6 +24,7 @@
 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 @@
 
 	req.url = u;
 	req.http = self;
+	req.time = os_time();
 
 	if not req.path then
 		req.path = "/";