Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: tarantool-patches@freelists.org
Subject: [PATCH 09/12] vinyl: don't account secondary indexes to scheduler.dump_input
Date: Tue, 15 Jan 2019 17:17:18 +0300	[thread overview]
Message-ID: <4826a1a65e7eb8fc3b35e09f7d87ab2fce890310.1547558871.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1547558871.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1547558871.git.vdavydov.dev@gmail.com>

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

  parent reply	other threads:[~2019-01-15 14:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 14:17 [PATCH 00/12] vinyl: statistics improvements Vladimir Davydov
2019-01-15 14:17 ` [PATCH 01/12] test: rename vinyl/info to vinyl/stat Vladimir Davydov
2019-01-17 11:32   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:17 ` [PATCH 02/12] test: split vinyl/errinj Vladimir Davydov
2019-01-17 11:33   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:17 ` [PATCH 03/12] vinyl: rename dump/compact in/out to input/output Vladimir Davydov
2019-01-17 11:33   ` [tarantool-patches] " Konstantin Osipov
2019-01-15 14:17 ` [PATCH 04/12] vinyl: rename compact to compaction Vladimir Davydov
2019-01-17 11:34   ` [tarantool-patches] " Konstantin Osipov
2019-01-17 12:08     ` Vladimir Davydov
2019-01-17 13:51       ` Konstantin Osipov
2019-01-15 14:17 ` [PATCH 05/12] vinyl: bump range version in vy_range.c Vladimir Davydov
2019-01-15 14:17 ` [PATCH 06/12] vinyl: don't add dropped LSM trees to the scheduler during recovery Vladimir Davydov
2019-01-15 14:17 ` [PATCH 07/12] vinyl: move global dump/compaction statistics to scheduler Vladimir Davydov
2019-01-16 16:36   ` Vladimir Davydov
2019-01-15 14:17 ` [PATCH 08/12] vinyl: add dump count to global scheduler statistics Vladimir Davydov
2019-01-15 14:17 ` Vladimir Davydov [this message]
2019-01-15 14:17 ` [PATCH 10/12] vinyl: add task accounting " Vladimir Davydov
2019-01-15 14:17 ` [PATCH 11/12] vinyl: add dump/compaction time to statistics Vladimir Davydov
2019-01-15 14:17 ` [PATCH 12/12] vinyl: add last level size " Vladimir Davydov
2019-01-17 11:35   ` [tarantool-patches] " Konstantin Osipov
2019-01-17 11:32 ` [tarantool-patches] Re: [PATCH 00/12] vinyl: statistics improvements Konstantin Osipov
2019-01-17 12:06   ` Vladimir Davydov
2019-01-20 21:16 ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4826a1a65e7eb8fc3b35e09f7d87ab2fce890310.1547558871.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 09/12] vinyl: don'\''t account secondary indexes to scheduler.dump_input' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox