File: admin.result

package info (click to toggle)
tarantool 1.9.1.26.g63eb81e3c-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 38,724 kB
  • sloc: ansic: 247,425; cpp: 24,952; sh: 17,809; python: 10,699; makefile: 2,682
file content (273 lines) | stat: -rw-r--r-- 5,649 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
env = require('test_run')
---
...
test_run = env.new()
---
...
test_run:cmd('restart server default')
space = box.schema.space.create('tweedledum')
---
...
index = space:create_index('primary')
---
...
help()
---
- - To get help, see the Tarantool manual at http://tarantool.org/doc/
  - To start the interactive Tarantool tutorial, type 'tutorial()'
...
cfg_filter(box.cfg)
---
- - - background
    - false
  - - checkpoint_count
    - 2
  - - checkpoint_interval
    - 3600
  - - coredump
    - false
  - - force_recovery
    - false
  - - hot_standby
    - false
  - - listen
    - <hidden>
  - - log
    - <hidden>
  - - log_format
    - plain
  - - log_level
    - 5
  - - log_nonblock
    - true
  - - memtx_dir
    - <hidden>
  - - memtx_max_tuple_size
    - <hidden>
  - - memtx_memory
    - 107374182
  - - memtx_min_tuple_size
    - <hidden>
  - - pid_file
    - <hidden>
  - - read_only
    - false
  - - readahead
    - 16320
  - - replication_connect_timeout
    - 30
  - - replication_sync_lag
    - 10
  - - replication_timeout
    - 1
  - - rows_per_wal
    - 500000
  - - slab_alloc_factor
    - 1.05
  - - too_long_threshold
    - 0.5
  - - vinyl_bloom_fpr
    - 0.05
  - - vinyl_cache
    - 134217728
  - - vinyl_dir
    - <hidden>
  - - vinyl_max_tuple_size
    - 1048576
  - - vinyl_memory
    - 134217728
  - - vinyl_page_size
    - 8192
  - - vinyl_range_size
    - 1073741824
  - - vinyl_read_threads
    - 1
  - - vinyl_run_count_per_level
    - 2
  - - vinyl_run_size_ratio
    - 3.5
  - - vinyl_timeout
    - 60
  - - vinyl_write_threads
    - 2
  - - wal_dir
    - <hidden>
  - - wal_dir_rescan_delay
    - 2
  - - wal_max_size
    - 268435456
  - - wal_mode
    - write
  - - worker_pool_threads
    - 4
...
space:insert{1, 'tuple'}
---
- [1, 'tuple']
...
box.snapshot()
---
- ok
...
space:delete{1}
---
- [1, 'tuple']
...
test_run:cmd("setopt delimiter ';'")
---
- true
...
function check_type(arg, typeof)
    return type(arg) == typeof
end;
---
...
function test_box_info()
    local tmp = box.info()
    local num = {'pid', 'uptime'}
    local str = {'version', 'status' }
    local failed = {}
    if check_type(tmp.replication, 'table') == false then
        table.insert(failed, 'box.info().replication')
    else
        tmp.replication = nil
    end
    for k, v in ipairs(num) do
        if check_type(tmp[v], 'number') == false then
            table.insert(failed, 'box.info().'..v)
        else
            tmp[v] = nil
        end
    end
    for k, v in ipairs(str) do
        if check_type(tmp[v], 'string') == false then
            table.insert(failed, 'box.info().'..v)
        else
            tmp[v] = nil
        end
    end
    if #tmp > 0 or #failed > 0 then
        return 'box.info() is not ok.', 'failed: ', failed, tmp
    else
        return 'box.info() is ok.'
    end
end;
---
...
function test_slab(tbl)
    local num = {'item_size', 'item_count', 'slab_size', 'slab_count', 'mem_used', 'mem_free'}
    local failed = {}
    for k, v in ipairs(num) do
        if check_type(tbl[v], 'number') == false then
            table.insert(failed, 'box.slab.info().<slab_size>.'..v)
        else
            tbl[v] = nil
        end
    end
    if #tbl > 0 or #failed > 0 then
        return false, failed
    else
        return true, {}
    end
end;
---
...
function test_box_slab_info()
    local tmp = box.slab.info()
    local tmp_slabs = box.slab.stats()
    local cdata = {'arena_size', 'arena_used'}
    local failed = {}
    if type(tmp_slabs) == 'table' then
        for name, tbl in ipairs(tmp_slabs) do
            local bl, fld = test_slab(tbl)
            if bl == true then
                tmp[name] = nil
            else
                for k, v in ipairs(fld) do
                    table.insert(failed, v)
                end
            end
        end
    else
        table.insert(failed, 'box.slab.info().slabs is not ok')
    end
    if #tmp_slabs == 0 then
        tmp_slabs = nil
    end
    for k, v in ipairs(cdata) do
        if check_type(tmp[v], 'number') == false then
            table.insert(failed, 'box.slab.info().'..v)
        else
            tmp[v] = nil
        end
    end
    if #tmp > 0 or #failed > 0 then
        return "box.slab.info() is not ok", tmp, failed
    else
        return "box.slab.info() is ok"
    end
end;
---
...
function test_fiber(tbl)
    local num = {'fid', 'csw'}
    for k, v in ipairs(num) do
        if check_type(tmp[v], 'number') == false then
            table.insert(failed, "require('fiber').info().<fiber_name>."..v)
        else
            tmp[v] = nil
        end
    end
    if type(tbl.backtrace) == 'table' and #tbl.backtrace > 0 then
        tbl.backtrace = nil
    else
        table.insert(failed, 'backtrace')
    end
    if #tbl > 0 or #failed > 0 then
        return false, failed
    else
        return true, {}
    end
end;
---
...
function test_box_fiber_info()
    local tmp = require('fiber').info()
    local failed = {}
    for name, tbl in ipairs(tmp) do
        local bl, fld = test_fiber(tbl)
        if bl == true then
            tmp[name] = nil
        else
            for k, v in ipairs(fld) do
                table.insert(failed, v)
            end
        end
    end
    if #tmp > 0 or #failed > 0 then
        return "require('fiber').info is not ok. failed: ", tmp, failed
    else
        return "require('fiber').info() is ok"
    end
end;
---
...
test_box_info();
---
- box.info() is ok.
...
test_box_slab_info();
---
- box.slab.info() is ok
...
test_box_fiber_info();
---
- require('fiber').info() is ok
...
space:drop();
---
...
test_run:cmd("setopt delimiter ''");
---
- true
...