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 7DA306EC5D; Thu, 8 Apr 2021 10:34:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7DA306EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617867298; bh=q0s66QfxiUAlQ9ZBmhchktv1z0SgTFip+hFO/gO4418=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=CgGvjh982M9IUVgaY+HFmIlpQNSYN992ogXfWxSCIs3uzDSM1BF/BkcmA+9u9UKlT 0yCGq2w4LEVpAfrQjc1XPGqrE0YlD19/t+XLLkMjCDBnsJWWQoDBO9DVUcBL8qlGeU 2YJbRkVx6s6Q+GYV5MF1NNZEyfXIQc1u+W5NAZlE= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 8A48C6EC5D for ; Thu, 8 Apr 2021 10:34:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8A48C6EC5D Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1lUPBo-0005Gb-Q5; Thu, 08 Apr 2021 10:34:57 +0300 To: Cyrill Gorcunov , tml Cc: Vladislav Shpilevoy References: <20210405155823.1121042-1-gorcunov@gmail.com> Message-ID: <0661429d-3059-00ff-d2ea-89a06c99f117@tarantool.org> Date: Thu, 8 Apr 2021 10:34:56 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC17951DFF5B22C9C640BE5EAB58CFCE0F000894C459B0CD1B905115CDFBBFE7A294289AAF6250CEF6BD337093C379D3ACD67236096E73D0E14 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE728306843C9CFCFEAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A85D247F7B1E5F958638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B20CC1B0F87D2174AE94DCE5DDD28F22D4F04B652EEC242312D2E47CDBA5A96583C09775C1D3CA48CFE478A468B35FE767117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE73E6FFC934C583AE6D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C03071BDA2D7A0BB39B3661434B16C20AC78D18283394535A9E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BF06FF5FC0997E3F8EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A23F051236DBC9DA634D097F901B7558688B39FA754255D0DFB8CCF60F6B7FD3948E1CD14B953EB46D881970AB35D4937B355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A54B48DDB337219BA02D8D6680338C977B561A30247182C3CFD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3468964757141B82E0E19631061029BF8E7F8A1640991CDA880CC28FC4B7BB603FB1A45A34417E5FA11D7E09C32AA3244C9EF07FF7B62FD34B033A884744B6CEC405AB220A9D022EBCFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioju+jaMfvANXqP8rw3SXm5qw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7695F864DBFB5D01428837FFD2FE15B20E960497F7EF99AAC8F32C2A64043BFB05F66FEC6BF5C9C28D9D2F9AC31ED4B18F0B80F102789B70DF27402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3] qsync: provide box.info interface for monitoring 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 05.04.2021 23:34, Cyrill Gorcunov пишет: > Guys, here is an updated version. Take a look please. > Vlad, lets stick with simple version and will add > `queues` array if we ever really need to. Hi! Thanks for the patch! Please find one comment below. > > issue https://github.com/tarantool/tarantool/issues/5191 > branch gorcunov/gh-5191-qsync-stat-3 > --- > > diff --git a/src/box/lua/info.c b/src/box/lua/info.c > index 8cd379756..a2ffff4b5 100644 > --- a/src/box/lua/info.c > +++ b/src/box/lua/info.c > @@ -50,6 +50,7 @@ > #include "version.h" > #include "box/box.h" > #include "box/raft.h" > +#include "box/txn_limbo.h" > #include "lua/utils.h" > #include "fiber.h" > #include "sio.h" > @@ -599,6 +600,29 @@ lbox_info_election(struct lua_State *L) > return 1; > } > > +static int > +lbox_info_synchro(struct lua_State *L) > +{ > + lua_newtable(L); Maybe change to lua_createtable(L, 0, 2) ? This will be consistent with what is done below, and lua doc states that'll be a bit faster: https://www.lua.org/manual/5.3/manual.html#lua_newtable (sorry, a direct link to lua_createtable didn't work) > + > + /* Quorum value may be evaluated via formula */ > + lua_pushinteger(L, replication_synchro_quorum); > + lua_setfield(L, -2, "quorum"); > + > + /* > + * Queue information. > + */ > + struct txn_limbo *queue = &txn_limbo; > + lua_createtable(L, 0, 1); > + lua_pushstring(L, "len"); > + lua_pushnumber(L, queue->len); > + lua_settable(L, -3); > + lua_setfield(L, -2, "queue"); > + > + return 1; > +} > + > + > static const struct luaL_Reg lbox_info_dynamic_meta[] = { > {"id", lbox_info_id}, > {"uuid", lbox_info_uuid}, > @@ -618,6 +642,7 @@ static const struct luaL_Reg lbox_info_dynamic_meta[] = { > {"sql", lbox_info_sql}, > {"listen", lbox_info_listen}, > {"election", lbox_info_election}, > + {"synchro", lbox_info_synchro}, > {NULL, NULL} > }; > -- Serge Petrenko