From 9cd74db01160fe3612f8638f362200ca129fc9c3 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 18 Oct 2022 03:14:00 +0800 Subject: [PATCH] Update webstats_common.lua --- plugins/webstats/lua/webstats_common.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index f6f417ea2..76e8d8e46 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -419,19 +419,19 @@ function _M.store_logs_line(self, db, stmt, input_sn, info) end stmt:reset() - -- local res ,err = self:update_stat( db, "client_stat", time_key, client_stat_fields) - -- -- self:D("step res:"..tostring(res) ..",step err:"..tostring(err)) - -- local res ,err = self:update_stat( db, "spider_stat", time_key, spider_stat_fields) - -- -- self:D("step res:"..tostring(res) ..",step err:"..tostring(err)) - -- -- self:D("stat ok"..) - - -- -- only count non spider requests - -- local ok, err = self:statistics_uri(db, request_uri, ngx.md5(request_uri), body_length) - -- local ok, err = self:statistics_ip(db, ip, body_length) - -- -- self:D("stat url ip ok") + local res ,err = self:update_stat( db, "client_stat", time_key, client_stat_fields) + -- self:D("step res:"..tostring(res) ..",step err:"..tostring(err)) + local res ,err = self:update_stat( db, "spider_stat", time_key, spider_stat_fields) + -- self:D("step res:"..tostring(res) ..",step err:"..tostring(err)) + -- self:D("stat ok"..) + + -- only count non spider requests + local ok, err = self:statistics_uri(db, request_uri, ngx.md5(request_uri), body_length) + local ok, err = self:statistics_ip(db, ip, body_length) + -- self:D("stat url ip ok") end - -- self:update_stat( db, "request_stat", time_key, request_stat_fields) + self:update_stat( db, "request_stat", time_key, request_stat_fields) return true end