From fc44fb58fb760e8ff4d723dd33d8825ba69793e4 Mon Sep 17 00:00:00 2001 From: lenkis Date: Mon, 23 Sep 2024 19:41:14 +0300 Subject: [PATCH 1/3] Add info on box.stat.memtx().data and box.stat.memtx().index --- .../reference_lua/box_stat/memtx.rst | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/doc/reference/reference_lua/box_stat/memtx.rst b/doc/reference/reference_lua/box_stat/memtx.rst index 97f967757..454c58667 100644 --- a/doc/reference/reference_lua/box_stat/memtx.rst +++ b/doc/reference/reference_lua/box_stat/memtx.rst @@ -9,6 +9,64 @@ box.stat.memtx() Shows ``memtx`` storage engine activity. +.. _box_introspection-box_stat_memtx_data: + +box.stat.memtx().data +--------------------- + +``data`` shows how much memory (in bytes) is allocated for memtx tuples: + +* ``data.garbage`` is the amount of memory that is unused and scheduled to be freed + (freed lazily on memory allocation). + +* ``data.total`` is the total amount of memory allocated for data tuples. + This includes ``data.read_view`` and ``data.garbage`` plus tuples that are + actually stored in memtx spaces. + +* ``data.read_view`` is the amount of memory held for read views. + This includes memory allocated both for system read views (snapshot, replication) + and user read views (EE-only). This should be non-zero only if there are open read views. + + To list all open read views, use :ref:`box.read_view.list() `. + + **Example:** + + .. code-block:: tarantoolsession + + tarantool> box.stat.memtx().data + --- + - garbage: 0 + total: 25334 + read_view: 0 + ... + +.. _box_introspection-box_stat_memtx_index: + +box.stat.memtx().index +---------------------- + +``index`` shows how much memory (in bytes) is allocated for memtx index extentions: + +* ``index.read_view`` is the amount of memory held for read views. + This includes memory allocated both for system read views (snapshot, replication) + and user read views (EE-only). This should be non-zero only if there are open read views. + + To list all open read views, use :ref:`box.read_view.list() `. + +* ``index.total`` is the total amount of memory allocated for + indexing data. This includes ``index.read_view`` plus memory used for indexing + tuples that are actually stored in memtx spaces. + + **Example:** + + .. code-block:: tarantoolsession + + tarantool> box.stat.memtx().index + --- + - read_view: 0 + total: 1032192 + ... + .. _box_introspection-box_stat_memtx_tx: box.stat.memtx().tx From dbc451ec5ca4961f02c9d947512d3ae58f8c626b Mon Sep 17 00:00:00 2001 From: lenkis Date: Mon, 23 Sep 2024 20:29:40 +0300 Subject: [PATCH 2/3] Fix indents in examples --- .../reference_lua/box_stat/memtx.rst | 120 +++++++++--------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/doc/reference/reference_lua/box_stat/memtx.rst b/doc/reference/reference_lua/box_stat/memtx.rst index 454c58667..ab5bdaa44 100644 --- a/doc/reference/reference_lua/box_stat/memtx.rst +++ b/doc/reference/reference_lua/box_stat/memtx.rst @@ -31,14 +31,14 @@ box.stat.memtx().data **Example:** - .. code-block:: tarantoolsession +.. code-block:: tarantoolsession - tarantool> box.stat.memtx().data - --- - - garbage: 0 - total: 25334 - read_view: 0 - ... + tarantool> box.stat.memtx().data + --- + - garbage: 0 + total: 25334 + read_view: 0 + ... .. _box_introspection-box_stat_memtx_index: @@ -59,13 +59,13 @@ box.stat.memtx().index **Example:** - .. code-block:: tarantoolsession +.. code-block:: tarantoolsession - tarantool> box.stat.memtx().index - --- - - read_view: 0 - total: 1032192 - ... + tarantool> box.stat.memtx().index + --- + - read_view: 0 + total: 1032192 + ... .. _box_introspection-box_stat_memtx_tx: @@ -182,52 +182,52 @@ Calling ``box.stat.memtx.tx()`` now returns the following result: .. code-block:: tarantoolsession :emphasize-lines: 33-39 - tarantool> box.stat.memtx.tx() - --- - - txn: - statements: - max: 720 - avg: 720 - total: 720 - user: - max: 0 - avg: 0 - total: 0 - system: - max: 916 - avg: 916 - total: 916 - mvcc: - trackers: - max: 0 - avg: 0 - total: 0 - conflicts: - max: 0 - avg: 0 - total: 0 - tuples: - tracking: - stories: - count: 0 - total: 0 - retained: - count: 0 - total: 0 - used: - stories: - count: 6 - total: 944 - retained: - count: 2 - total: 119 - read_view: - stories: - count: 0 - total: 0 - retained: - count: 0 - total: 0 - ... + tarantool> box.stat.memtx.tx() + --- + - txn: + statements: + max: 720 + avg: 720 + total: 720 + user: + max: 0 + avg: 0 + total: 0 + system: + max: 916 + avg: 916 + total: 916 + mvcc: + trackers: + max: 0 + avg: 0 + total: 0 + conflicts: + max: 0 + avg: 0 + total: 0 + tuples: + tracking: + stories: + count: 0 + total: 0 + retained: + count: 0 + total: 0 + used: + stories: + count: 6 + total: 944 + retained: + count: 2 + total: 119 + read_view: + stories: + count: 0 + total: 0 + retained: + count: 0 + total: 0 + ... Pay attention to highlighted lines -- it's the memory allocated for `used` tuples. From 41f3b64a59a3500e07746a331b0b7dc070589a6b Mon Sep 17 00:00:00 2001 From: lenkis Date: Tue, 24 Sep 2024 12:30:29 +0300 Subject: [PATCH 3/3] Integrate tech feedback --- doc/reference/reference_lua/box_stat/memtx.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/box_stat/memtx.rst b/doc/reference/reference_lua/box_stat/memtx.rst index ab5bdaa44..f15f7cc8f 100644 --- a/doc/reference/reference_lua/box_stat/memtx.rst +++ b/doc/reference/reference_lua/box_stat/memtx.rst @@ -45,7 +45,7 @@ box.stat.memtx().data box.stat.memtx().index ---------------------- -``index`` shows how much memory (in bytes) is allocated for memtx index extentions: +``index`` shows how much memory (in bytes) is allocated for indexing memtx tuples: * ``index.read_view`` is the amount of memory held for read views. This includes memory allocated both for system read views (snapshot, replication)