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 E9F9E6EC5D; Thu, 8 Apr 2021 16:41:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E9F9E6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617889287; 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=VHSMuFOTfodPAMcYwSlmurpPIxnOeJYHMc+k61cv5k93gAijJ2f2nGOJeZ0d9DLKt zeTg/jmt6O1nRKE/53NU8V+MW0ASOf6rU8H5madM1sMPD2SZowKDk2yyploz+3F9gP IbxGODnjm1ToKABE8iOEGlP1JmWTIrv4rUL0gahk= Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (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 A74626EC5D for ; Thu, 8 Apr 2021 16:41:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A74626EC5D Received: by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1lUUuT-0000gw-SN; Thu, 08 Apr 2021 16:41:26 +0300 To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Date: Thu, 8 Apr 2021 16:38:37 +0300 Message-Id: <3a7e5e50540c9e5df3542e3ebb6167c806bab3da.1617888916.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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC11CA03434DF6EAA5F4478E741A4EA829900894C459B0CD1B94BABD4DD24CBFE54C743545AF970DEC838DE5FFF3BE30100C94F5D657025D6F1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE704BA85F3D5A9F85BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375FE8AD9F0D2764EB8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2FE715D345F877D897AB20B5C9C92FFC2CCD65611471A2689D2E47CDBA5A96583C09775C1D3CA48CF90BCC82C2C62A6D1117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C39472471D10B198B935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC09B348080E458430BDEA43F0A6D2AB2117341DD5D8A257B0B1881A6453793CE9C32612AADDFBE061C61BE10805914D3804EBA3D8E7E5B87ABF8C51168CD8EBDB63AF70AF8205D7DCDC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3419891600CCEF460781A2CDBCB3049D4F2769376EB982D3B8B1CFD43993D775CCCD298B983504AF411D7E09C32AA3244C49D6F4A3DF609D635C85C3F24EFF4C6869B6CAE0477E908D927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioju+jaMfvANXoik6DBQs2cWQ== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A4465E4806B976005D2A865ECBD771B6ED08A6F9C1D197697431424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 1/5] 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)