diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d75eb4f..58b61af0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,6 +40,10 @@ jobs: cartridge: "2.8.4" - tarantool: "2.10" cartridge: "" + - tarantool: "3.0" + cartridge: "" + - tarantool: "3.1" + cartridge: "" runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 diff --git a/test/tarantool/memtx_metrics_test.lua b/test/tarantool/memtx_metrics_test.lua index ce042127..91aa4840 100644 --- a/test/tarantool/memtx_metrics_test.lua +++ b/test/tarantool/memtx_metrics_test.lua @@ -63,3 +63,34 @@ g.test_memtx = function(cg) end end) end + +g.test_memtx_read_view = function(cg) + t.skip_if(utils.is_version_less(_TARANTOOL, '3.1.0'), + 'Tarantool version is must be v3.1.0 or greater') + + cg.server:exec(function() + local metrics = require('metrics') + local memtx = require('metrics.tarantool.memtx') + local utils = require('test.utils') -- luacheck: ignore 431 + + metrics.enable_default_metrics() + memtx.update() + local default_metrics = metrics.collect() + local log = require('log') + + local metrics_list = { + 'tnt_memtx_tuples_data_total', + 'tnt_memtx_tuples_data_read_view', + 'tnt_memtx_tuples_data_garbage', + 'tnt_memtx_index_total', + 'tnt_memtx_index_read_view', + } + + for _, item in ipairs(metrics_list) do + log.info('checking metric: ' .. item) + local metric = utils.find_metric(item, default_metrics) + t.assert(metric) + t.assert_type(metric[1].value, 'number') + end + end) +end