Skip to content

Commit 1926a6c

Browse files
Revert "cpu: add instance CPU usage metric"
This reverts commit 7993bb3.
1 parent 7993bb3 commit 1926a6c

File tree

9 files changed

+0
-57
lines changed

9 files changed

+0
-57
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ jobs:
3939
cartridge: ""
4040
- tarantool: "3.3"
4141
cartridge: ""
42-
- tarantool: "3.4"
43-
cartridge: ""
4442
runs-on: ubuntu-24.04
4543
steps:
4644
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11-
- `tnt_cpu_instance` metric.
12-
1311
### Changed
1412

1513
### Fixed

doc/monitoring/metrics_reference.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,6 @@ They are only available on Linux.
527527
* ``kind`` can be either ``user`` or ``system``
528528
* ``thread_name`` is ``tarantool``, ``wal``, ``iproto``, or ``coio``
529529
* ``file_name`` is the entrypoint file name, for example, ``init.lua``.
530-
* - ``tnt_cpu_instance``
531-
- Tarantool instance CPU time.
532-
This metric always has the labels
533-
``{kind="user"}``,
534-
where:
535-
536-
* ``kind`` can be either ``user`` or ``system``.
537530

538531
There are also two cross-platform metrics, which can be obtained with a ``getrusage()`` call.
539532

metrics/psutils/cpu.lua

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,6 @@ local function update_cpu_metrics()
4949
collectors_list.cpu_thread:remove(thread_info)
5050
end
5151
threads = new_threads
52-
53-
local instance_info = psutils.get_instance_cpu_time()
54-
if instance_info ~= nil then
55-
local instance_stime_labels = {kind = 'system'}
56-
collectors_list.instance_cpu_usage = utils.set_gauge('cpu_instance',
57-
'Tarantool instance cpu time', instance_info.stime,
58-
instance_stime_labels, nil, {default = true})
59-
60-
local instance_utime_labels = {kind = 'user'}
61-
collectors_list.instance_cpu_usage = utils.set_gauge('cpu_instance',
62-
'Tarantool instance cpu time', instance_info.utime,
63-
instance_utime_labels, nil, {default = true})
64-
65-
end
6652
end
6753

6854
local function clear_cpu_metrics()

metrics/psutils/psutils_linux.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,8 @@ local function get_process_cpu_time()
6666
return thread_time
6767
end
6868

69-
local function get_instance_cpu_time()
70-
return parse_process_stat('/proc/self/stat')
71-
end
72-
7369
return {
7470
get_cpu_time = get_cpu_time,
7571
get_process_cpu_time = get_process_cpu_time,
76-
get_instance_cpu_time = get_instance_cpu_time,
7772
get_cpu_count = get_nprocs_conf,
7873
}

test/psutils_linux_test.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,3 @@ g.test_get_cpu_count = function(cg)
5252
t.assert_gt(psutils_linux.get_cpu_count(), 0)
5353
end)
5454
end
55-
56-
g.test_get_instance_cpu_time = function(cg)
57-
cg.server:exec(function()
58-
local psutils_linux = require('metrics.psutils.psutils_linux')
59-
local expected = {pid = 280908, comm = 'tarantool', utime = 222, stime = 111}
60-
t.assert_items_equals(psutils_linux.get_instance_cpu_time(), expected)
61-
end)
62-
end

test/psutils_linux_test_payload/init.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
local payload_dir = debug.sourcedir()
22
local stat_file_path = payload_dir .. '/proc_stat'
3-
local self_stat_file_path = payload_dir .. '/proc_self_stat'
43
local task_dir_path = payload_dir .. '/proc_self_task'
54

65
return {
76
files = {
87
['/proc/stat'] = stat_file_path,
9-
['/proc/self/stat'] = self_stat_file_path,
108
['/proc/self/task/1/stat'] = task_dir_path .. '/1/stat',
119
['/proc/self/task/12/stat'] = task_dir_path .. '/12/stat',
1210
['/proc/self/task/13/stat'] = task_dir_path .. '/13/stat',

test/psutils_linux_test_payload/proc_self_stat

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/psutils_linux_thread_clean_test.lua

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,6 @@ g.test_cpu_count = function(cg)
5656
end)
5757
end
5858

59-
g.test_instance_cpu = function(cg)
60-
cg.server:exec(function()
61-
local metrics = require('metrics')
62-
local utils = require('test.utils') -- luacheck: ignore 431
63-
64-
require('metrics.psutils.cpu').update()
65-
66-
local observations = metrics.collect()
67-
local metric = utils.find_metric('tnt_cpu_instance', observations)
68-
t.assert_not_equals(metric, nil)
69-
t.assert_equals(#metric, 2)
70-
t.assert_gt(metric[1].value, 0)
71-
t.assert_gt(metric[2].value, 0)
72-
end)
73-
end
7459

7560
g.test_clear = function(cg)
7661
cg.server:exec(function()
@@ -86,7 +71,6 @@ g.test_clear = function(cg)
8671
'tnt_cpu_number',
8772
'tnt_cpu_time',
8873
'tnt_cpu_thread',
89-
'tnt_cpu_instance',
9074
}
9175

9276
for _, metric_name in ipairs(expected) do

0 commit comments

Comments
 (0)