mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
metrics - fix request timestamp
This commit is contained in:
parent
503868b5d6
commit
a7a9055b8c
2 changed files with 4 additions and 2 deletions
|
|
@ -185,7 +185,7 @@ helpers.fill_ctx = function(no_ref)
|
|||
end
|
||||
data.remote_addr = var.remote_addr
|
||||
data.server_name = var.server_name
|
||||
data.local_time = var.local_time
|
||||
data.time_local = var.time_local
|
||||
if data.kind == "http" then
|
||||
data.uri = var.uri
|
||||
data.request_uri = var.request_uri
|
||||
|
|
@ -196,6 +196,7 @@ helpers.fill_ctx = function(no_ref)
|
|||
data.http_content_length = var.http_content_length
|
||||
data.http_origin = var.http_origin
|
||||
data.http_version = req.http_version()
|
||||
data.start_time = req.start_time()
|
||||
data.scheme = var.scheme
|
||||
end
|
||||
-- IP data : global
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ local encode = cjson.encode
|
|||
local decode = cjson.decode
|
||||
|
||||
local match = string.match
|
||||
local time = os.time
|
||||
|
||||
function metrics:initialize(ctx)
|
||||
-- Call parent initialize
|
||||
|
|
@ -50,7 +51,7 @@ function metrics:log()
|
|||
end
|
||||
end
|
||||
local request = {
|
||||
date = os.time(),
|
||||
date = self.ctx.bw.start_time or time(),
|
||||
ip = self.ctx.bw.remote_addr,
|
||||
country = country,
|
||||
method = self.ctx.bw.request_method,
|
||||
|
|
|
|||
Loading…
Reference in a new issue