memtx: refactor statistics reporting
`box.stat.memtx` is a table that contains the 'tx' function. This is confusing because other stat entries are callable: `box.stat.net()`, `box.stat.vinyl()`, `box.stat.sql()`. Let's make `box.stat.memtx` callable for consistency. The function returns a table with the only field 'tx'. Note, we can't drop `box.stat.memtx.tx()` without breaking backward compatibility so we now return `box.stat.memtx().tx` when it's called. Also, let's use `info_handler` instead of pushing statistics directly to Lua for better encapsulation. Needed for https://github.com/tarantool/tarantool-ee/issues/143 Closes #8448 NO_DOC=updated https://github.com/tarantool/doc/issues/2801 (cherry picked from commit 89a60d82)
Showing
- changelogs/unreleased/gh-8448-box-stat-memtx-func.md 5 additions, 0 deletionschangelogs/unreleased/gh-8448-box-stat-memtx-func.md
- src/box/lua/stat.c 38 additions, 146 deletionssrc/box/lua/stat.c
- src/box/memtx_engine.cc 75 additions, 0 deletionssrc/box/memtx_engine.cc
- src/box/memtx_engine.h 10 additions, 0 deletionssrc/box/memtx_engine.h
- test/box-luatest/gh_6150_memtx_tx_memory_monitoring_test.lua 7 additions, 0 deletionstest/box-luatest/gh_6150_memtx_tx_memory_monitoring_test.lua
Loading
Please register or sign in to comment