Skip to content

Commit dc044a6

Browse files
Merge pull request #77 from tarantool/66-nocrud-operations
Add non-CRUD operations panels, rework "Tarantool spaces statistics" block
2 parents 98a6b1f + 3f97adc commit dc044a6

File tree

9 files changed

+1852
-216
lines changed

9 files changed

+1852
-216
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Cartridge issues metrics labels to Telegraf configuration
1313
- Cartridge issues panels and "Cluster overview" row
1414
- Network activity row and panels
15+
- Non-CRUD operations panels
1516

1617
## Changed
1718
- Update metrics version to 0.9.0
1819
- Separate app cluster and load generator in example docker stand
1920
- Use cartridge-cli to run and setup example app cluster instead of luatest
2021
- Group Prometheus cluster overview panels into "Cluster overview" row
22+
- Rework "Tarantool spaces statistics" block to "Tarantool operations statistics"
23+
- Use Tarantool 2.x instead of Tarantool 1.x in test app and load generator
2124

2225
## Fixed
2326
- Add missing space and replication metrics labels to Telegraf configuration

example/project/app.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM tarantool/tarantool:1.x-centos7
1+
FROM tarantool/tarantool:2.x-centos7
22

33
WORKDIR /app
44

example/project/generate_load.lua

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,20 @@ local function generate_space_load(name, instance)
140140
end
141141
end
142142

143+
local function generate_operations_load(name, instance)
144+
if name:match('storage') ~= nil then
145+
instance.net_box:eval([[return box.execute("VALUES ('hello');")]])
146+
147+
if math.random(0, 100) == 25 then
148+
-- duplicate key error and read-only instance error
149+
pcall(instance.net_box.space.MY_SPACE.insert, instance.net_box.space.MY_SPACE, {0, random_string(5)})
150+
end
151+
end
152+
153+
if name:match('router') ~= nil then
154+
instance.net_box:eval('return true')
155+
end
156+
end
143157

144158
local f = fio.open('instances.yml')
145159
local instances = yaml.decode(f:read())
@@ -165,19 +179,17 @@ for _, instance in pairs(instances) do
165179
pcall(instance.net_box.eval, instance.net_box, 'return box.space.MY_SPACE:truncate()')
166180
end
167181

182+
local load_generators = { generate_http_load, generate_space_load, generate_operations_load }
183+
168184
while true do
169185
for name, instance in pairs(instances) do
170-
local _, err = pcall(generate_http_load, name, instance)
171-
if err ~= nil then
172-
log.error(err)
173-
fiber.sleep(1)
174-
end
175-
176-
local _, err = pcall(generate_space_load, name, instance)
177-
if err ~= nil then
178-
log.error(err)
179-
fiber.sleep(1)
186+
for _, load_generator in ipairs(load_generators) do
187+
local _, err = pcall(load_generator, name, instance)
188+
if err ~= nil then
189+
log.error(err)
190+
fiber.sleep(1)
191+
end
192+
fiber.yield()
180193
end
181-
fiber.yield()
182194
end
183195
end

example/project/load.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM tarantool/tarantool:1.x-centos7
1+
FROM tarantool/tarantool:2.x-centos7
22

33
WORKDIR /app
44

tarantool/dashboard.libsonnet

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ local cluster = import 'cluster.libsonnet';
44
local http = import 'http.libsonnet';
55
local memory_misc = import 'memory_misc.libsonnet';
66
local net = import 'net.libsonnet';
7+
local operations = import 'operations.libsonnet';
78
local slab = import 'slab.libsonnet';
8-
local space = import 'space.libsonnet';
99
local row = grafana.row;
1010

1111
{
@@ -271,11 +271,11 @@ local row = grafana.row;
271271
{ w: 24, h: 8, x: 0, y: 69 + offset },
272272
)
273273
.addPanel(
274-
row.new(title='Tarantool spaces statistics'),
274+
row.new(title='Tarantool operations statistics'),
275275
{ w: 24, h: 1, x: 0, y: 77 + offset }
276276
)
277277
.addPanel(
278-
space.select_rps(
278+
operations.space_select_rps(
279279
datasource=datasource,
280280
policy=policy,
281281
measurement=measurement,
@@ -285,7 +285,7 @@ local row = grafana.row;
285285
{ w: 8, h: 8, x: 0, y: 78 + offset },
286286
)
287287
.addPanel(
288-
space.insert_rps(
288+
operations.space_insert_rps(
289289
datasource=datasource,
290290
policy=policy,
291291
measurement=measurement,
@@ -295,7 +295,7 @@ local row = grafana.row;
295295
{ w: 8, h: 8, x: 8, y: 78 + offset },
296296
)
297297
.addPanel(
298-
space.replace_rps(
298+
operations.space_replace_rps(
299299
datasource=datasource,
300300
policy=policy,
301301
measurement=measurement,
@@ -305,7 +305,7 @@ local row = grafana.row;
305305
{ w: 8, h: 8, x: 16, y: 78 + offset },
306306
)
307307
.addPanel(
308-
space.upsert_rps(
308+
operations.space_upsert_rps(
309309
datasource=datasource,
310310
policy=policy,
311311
measurement=measurement,
@@ -315,7 +315,7 @@ local row = grafana.row;
315315
{ w: 8, h: 8, x: 0, y: 86 + offset },
316316
)
317317
.addPanel(
318-
space.update_rps(
318+
operations.space_update_rps(
319319
datasource=datasource,
320320
policy=policy,
321321
measurement=measurement,
@@ -325,13 +325,73 @@ local row = grafana.row;
325325
{ w: 8, h: 8, x: 8, y: 86 + offset },
326326
)
327327
.addPanel(
328-
space.delete_rps(
328+
operations.space_delete_rps(
329329
datasource=datasource,
330330
policy=policy,
331331
measurement=measurement,
332332
job=job,
333333
rate_time_range=rate_time_range,
334334
),
335335
{ w: 8, h: 8, x: 16, y: 86 + offset },
336+
)
337+
.addPanel(
338+
operations.call_rps(
339+
datasource=datasource,
340+
policy=policy,
341+
measurement=measurement,
342+
job=job,
343+
rate_time_range=rate_time_range,
344+
),
345+
{ w: 8, h: 8, x: 0, y: 94 + offset },
346+
)
347+
.addPanel(
348+
operations.eval_rps(
349+
datasource=datasource,
350+
policy=policy,
351+
measurement=measurement,
352+
job=job,
353+
rate_time_range=rate_time_range,
354+
),
355+
{ w: 8, h: 8, x: 8, y: 94 + offset },
356+
)
357+
.addPanel(
358+
operations.error_rps(
359+
datasource=datasource,
360+
policy=policy,
361+
measurement=measurement,
362+
job=job,
363+
rate_time_range=rate_time_range,
364+
),
365+
{ w: 8, h: 8, x: 16, y: 94 + offset },
366+
)
367+
.addPanel(
368+
operations.auth_rps(
369+
datasource=datasource,
370+
policy=policy,
371+
measurement=measurement,
372+
job=job,
373+
rate_time_range=rate_time_range,
374+
),
375+
{ w: 8, h: 8, x: 0, y: 102 + offset },
376+
)
377+
.addPanel(
378+
operations.SQL_prepare_rps(
379+
datasource=datasource,
380+
policy=policy,
381+
measurement=measurement,
382+
job=job,
383+
rate_time_range=rate_time_range,
384+
),
385+
{ w: 8, h: 8, x: 8, y: 102 + offset },
386+
)
387+
.addPanel(
388+
operations.SQL_execute_rps(
389+
datasource=datasource,
390+
policy=policy,
391+
measurement=measurement,
392+
job=job,
393+
rate_time_range=rate_time_range,
394+
),
395+
{ w: 8, h: 8, x: 16, y: 102 + offset },
336396
),
337397
}

0 commit comments

Comments
 (0)