From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladimir Davydov Subject: [PATCH 09/12] vinyl: don't account secondary indexes to scheduler.dump_input Date: Tue, 15 Jan 2019 17:17:18 +0300 Message-Id: <4826a1a65e7eb8fc3b35e09f7d87ab2fce890310.1547558871.git.vdavydov.dev@gmail.com> In-Reply-To: References: In-Reply-To: References: To: tarantool-patches@freelists.org List-ID: Indexes of the same space share a memory level so we should account them to box.stat.vinyl().scheduler.dump_input once per space dump, not each time an index is dumped. --- src/box/vy_scheduler.c | 7 ++++++- test/vinyl/stat.result | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/box/vy_scheduler.c b/src/box/vy_scheduler.c index d06da484..e49cd211 100644 --- a/src/box/vy_scheduler.c +++ b/src/box/vy_scheduler.c @@ -1269,7 +1269,12 @@ delete_mems: } lsm->dump_lsn = MAX(lsm->dump_lsn, dump_lsn); vy_lsm_acct_dump(lsm, &dump_input, &dump_output); - scheduler->stat.dump_input += dump_input.bytes; + /* + * Indexes of the same space share a memory level so we + * account dump input only when the primary index is dumped. + */ + if (lsm->index_id == 0) + scheduler->stat.dump_input += dump_input.bytes; scheduler->stat.dump_output += dump_output.bytes; /* The iterator has been cleaned up in a worker thread. */ diff --git a/test/vinyl/stat.result b/test/vinyl/stat.result index e8780e5b..3050e43d 100644 --- a/test/vinyl/stat.result +++ b/test/vinyl/stat.result @@ -1125,7 +1125,7 @@ box.snapshot() stat_diff(gstat(), st, 'scheduler') --- - dump_count: 1 - dump_input: 208400 + dump_input: 104200 dump_output: 103592 ... for i = 1, 100, 10 do s:replace{i, i, string.rep('y', 1000)} end @@ -1141,7 +1141,7 @@ box.snapshot() stat_diff(gstat(), st, 'scheduler') --- - dump_count: 1 - dump_input: 21230 + dump_input: 10420 dump_output: 10371 ... st = gstat() -- 2.11.0