From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 825216EC5D; Fri, 2 Apr 2021 17:58:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 825216EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617375531; bh=nkKK+uOxQj6E0fzY8WQut08M80GNui7AGW9hA4FcTRo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=qH0LsocEV68kz5b/iimreKIVZvTTskuKfn6NVi3oLUhkF7IlSo07DkAlduHyRg7S9 aD28C7dLQi1C9iPCCUrU6wZkw4TBnKM48fYyz5FoJePEEbf7udwutaUxpyRvRsMWUD PjDUc62c9XUhpz/RkPn5gdZ8PzF4mTbfavrS00AU= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7C76F6EC61 for ; Fri, 2 Apr 2021 17:58:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7C76F6EC61 Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1lSLFc-0006jR-8M; Fri, 02 Apr 2021 17:58:20 +0300 To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Date: Fri, 2 Apr 2021 17:58:00 +0300 Message-Id: <09e4315c7f323f851e4b252ebf3947199f30ef3b.1617375300.git.sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E329414CA9CC90B1691FBFCDCC6B467E25A08182A05F5380850404AF0566CE921DCD5F7146DC6DD9BC2967DAD1A7FB39D37211E1632F46BFAD7D4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73A0E02362971E860EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063790B55F3E386DB9B28638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7B5A45DDF210A4CFC400DDAAB3AEA3BCA40FE559DC005EBEA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7820CF4CC0E318EFB9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C353FA85A707D24CADCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224913302629575AB2B876E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8BAA64FD938D12D9763AA81AA40904B5D9DBF02ECDB25306B2201CA6A4E26CD07C3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735B58781B77DE60D36C4224003CC83647689D4C264860C145E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC518AE90F1FD46BBF1D4599B8B25E95D7A00285E0590853D3B1881A6453793CE9C32612AADDFBE061C61BE10805914D3804EBA3D8E7E5B87ABF8C51168CD8EBDB63AF70AF8205D7DCDC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344E332383F80D58BB5FCBF7CB46AF70A50A6503AEFBFC1BE6D3CCD77E6402F3AE4DFFDEC129B752C51D7E09C32AA3244C7B339050ACBCEFAB733453BC7EEFD9FB853296C06374E602927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXhDmqlpxPgE9wJIfQ09tp2s X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F81968ACF4E54473F814785651471E67D0B305FE45D4B78E85424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 1/4] feedback_daemon: include server uptime in the report X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" We are going to send feedback right after initial `box.cfg{}` call, so include server uptime in the report to filter out short-living CI instances. Also, while we're at it, fix a typo in feedback_daemon test. Prerequisite #5750 --- src/box/lua/feedback_daemon.lua | 3 ++- test/box-tap/feedback_daemon.test.lua | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/box/lua/feedback_daemon.lua b/src/box/lua/feedback_daemon.lua index d54d75414..8820bcde5 100644 --- a/src/box/lua/feedback_daemon.lua +++ b/src/box/lua/feedback_daemon.lua @@ -108,6 +108,7 @@ local function fill_in_base_info(feedback) feedback.tarantool_version = box.info.version feedback.server_id = box.info.uuid feedback.cluster_id = box.info.cluster.uuid + feedback.uptime = box.info.uptime end local function fill_in_platform_info(feedback) @@ -400,7 +401,7 @@ setmetatable(daemon, { end, -- this function is used in saving feedback in file generate_feedback = function() - return fill_in_feedback({ feedback_version = 5 }) + return fill_in_feedback({ feedback_version = 6 }) end, start = function() start(daemon) diff --git a/test/box-tap/feedback_daemon.test.lua b/test/box-tap/feedback_daemon.test.lua index 8cfbf31d7..e1c450d2b 100755 --- a/test/box-tap/feedback_daemon.test.lua +++ b/test/box-tap/feedback_daemon.test.lua @@ -70,7 +70,7 @@ if not ok then os.exit(0) end -test:plan(27) +test:plan(28) local function check(message) while feedback_count < 1 do @@ -123,9 +123,11 @@ local fio = require("fio") local fh = fio.open("feedback.json") test:ok(fh, "file is created") local file_data = fh:read() --- Ignore the report time. The data should be equal other than that. -feedback_save = string.gsub(feedback_save, '"time":(%d+)', 'time:0') -file_data = string.gsub(file_data, '"time":(%d+)', 'time:0') +-- Ignore the report time and uptime. The data should be equal other than that. +feedback_save = string.gsub(feedback_save, '"uptime":(%d+)', '"uptime":0') +file_data = string.gsub(file_data, '"uptime":(%d+)', '"uptime":0') +feedback_save = string.gsub(feedback_save, '"time":(%d+)', '"time":0') +file_data = string.gsub(file_data, '"time":(%d+)', '"time":0') test:is(file_data, feedback_save, "data is equal") fh:close() fio.unlink("feedback.json") @@ -288,5 +290,8 @@ test:is(fiber.time64(), actual.stats.time, "Time of report generation is correct check_stats(actual.stats) +actual = daemon.generate_feedback() +test:is(box.info.uptime, actual.uptime, "Server uptime is reported and is correct.") + test:check() os.exit(0) -- 2.24.3 (Apple Git-128)