-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add space.stat() and tuple.info() reference (#4373)
- Loading branch information
Showing
5 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.. _box_space-stat: | ||
|
||
space_object:stat() | ||
=================== | ||
|
||
.. class:: space_object | ||
|
||
.. method:: stat() | ||
|
||
Get statistics on memory usage by the space. | ||
|
||
Returns a table with the cumulative statistics on the memory usage by tuples in the space. | ||
Statistics are grouped by arena types: ``memtx`` or ``malloc``. | ||
For each arena type, the return table includes tuple memory usage statistics | ||
listed in the :ref:`box_tuple-info` reference. | ||
|
||
.. note:: | ||
|
||
Memory usage statistics are shown only for the memtx storage engine. | ||
For other types of spaces, an empty table is returned. | ||
|
||
:param space_object space_object: an :ref:`object reference | ||
<app_server-object_reference>` | ||
|
||
:return: space memory usage statistics | ||
:rtype: table | ||
|
||
**Possible errors:** ``space_object`` does not exist. | ||
|
||
|
||
**Example:** | ||
|
||
.. code-block:: tarantoolsession | ||
tarantool> box.space.tester:stat() | ||
--- | ||
- tuple: | ||
memtx: | ||
waste_size: 145 | ||
data_size: 235 | ||
header_size: 36 | ||
field_map_size: 24 | ||
malloc: | ||
waste_size: 0 | ||
data_size: 0 | ||
header_size: 0 | ||
field_map_size: 0 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
.. _box_tuple-info: | ||
|
||
tuple_object.info() | ||
=================== | ||
|
||
.. class:: tuple_object | ||
|
||
.. method:: info() | ||
|
||
Get information about the tuple memory usage. | ||
|
||
Returns a table with the following fields: | ||
|
||
- ``data_size`` -- size of MessagePack data in the tuple. | ||
This number equals to number returned by :ref:`box_tuple-bsize`. | ||
- ``header_size`` - size of the internal tuple header. | ||
- ``field_map_size`` -- size of the field map. | ||
Field map is used to speed up access to indexed fields of the tuple. | ||
- ``waste_size`` -- amount of excess memory wasted due to internal fragmentation in the `slab allocator <https://github.com/tarantool/small>`_. | ||
|
||
.. note:: | ||
|
||
`waste_size` is provided for reference only and can be inaccurate. | ||
Avoid using it for memory usage calculations. | ||
|
||
- ``arena`` - type of the arena where the tuple is allocated. | ||
Possible values are: ``memtx``, ``malloc``, ``runtime``. | ||
|
||
:return: tuple memory usage statistics | ||
:rtype: table | ||
|
||
|
||
**Example** | ||
|
||
.. code-block:: tarantoolsession | ||
tarantool> box.space.tester:get('222200000'):info() | ||
--- | ||
- data_size: 55 | ||
waste_size: 95 | ||
arena: memtx | ||
field_map_size: 4 | ||
header_size: 6 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters