Skip to content

Commit b3411e4

Browse files
dashboard: add panels for transaction operations
Add panels for transaction operations (begin, commit, rollback). Metrics were introduced in 2.10.0-beta1 [1] and fixed in 2.10.4 and 2.11 [2]. 1. tarantool/tarantool@48c8dc1 2. tarantool/tarantool@a5fe5c3 Closes #176
1 parent 2610ecf commit b3411e4

23 files changed

+10079
-3493
lines changed

CHANGELOG.md

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

99
### Added
1010
- Dashboard title customization
11+
- Panels for transaction operations
1112

1213
### Changed
1314
- Replace LuaJit deprecated metrics with new ones

dashboard/panels/operations.libsonnet

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,91 @@ local prometheus = grafana.prometheus;
351351
labelY1='requests per second',
352352
operation='execute'
353353
),
354+
355+
txn_begin_rps(
356+
title='Transaction begins',
357+
description=|||
358+
Panel displays the count of IPROTO_CALL and
359+
IPROTO_EVAL operations with `box.begin()`, IPROTO_EXECUTE
360+
operations with `TRANSACTION START` and IPROTO_BEGIN operations.
361+
Graph shows average calls per second.
362+
363+
Panel works with Tarantool 2.10 or newer.
364+
|||,
365+
datasource_type=null,
366+
datasource=null,
367+
policy=null,
368+
measurement=null,
369+
job=null,
370+
alias=null,
371+
):: operation_rps(
372+
title=title,
373+
description=description,
374+
datasource_type=datasource_type,
375+
datasource=datasource,
376+
policy=policy,
377+
measurement=measurement,
378+
job=job,
379+
alias=alias,
380+
labelY1='begins per second',
381+
operation='begin'
382+
),
383+
384+
txn_commit_rps(
385+
title='Transaction commits',
386+
description=|||
387+
Panel displays the count of IPROTO_CALL and
388+
IPROTO_EVAL operations with `box.commit()`, IPROTO_EXECUTE
389+
operations with `COMMIT` and IPROTO_COMMIT operations.
390+
Graph shows average calls per second.
391+
392+
Panel works with Tarantool 2.10 or newer.
393+
|||,
394+
datasource_type=null,
395+
datasource=null,
396+
policy=null,
397+
measurement=null,
398+
job=null,
399+
alias=null,
400+
):: operation_rps(
401+
title=title,
402+
description=description,
403+
datasource_type=datasource_type,
404+
datasource=datasource,
405+
policy=policy,
406+
measurement=measurement,
407+
job=job,
408+
alias=alias,
409+
labelY1='commits per second',
410+
operation='commit'
411+
),
412+
413+
txn_rollback_rps(
414+
title='Transaction rollbacks',
415+
description=|||
416+
Panel displays the count of IPROTO_CALL and
417+
IPROTO_EVAL operations with `box.rollback()`, IPROTO_EXECUTE
418+
operations with `ROLLBACK` and IPROTO_ROLLBACK operations.
419+
Graph shows average calls per second.
420+
421+
Panel works with Tarantool 2.10 or newer.
422+
|||,
423+
datasource_type=null,
424+
datasource=null,
425+
policy=null,
426+
measurement=null,
427+
job=null,
428+
alias=null,
429+
):: operation_rps(
430+
title=title,
431+
description=description,
432+
datasource_type=datasource_type,
433+
datasource=datasource,
434+
policy=policy,
435+
measurement=measurement,
436+
job=job,
437+
alias=alias,
438+
labelY1='rollbacks per second',
439+
operation='rollback'
440+
),
354441
}

dashboard/section.libsonnet

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,33 @@ local tdg_tuples = import 'dashboard/panels/tdg/tuples.libsonnet';
10601060
job=job,
10611061
alias=alias,
10621062
),
1063+
1064+
operations.txn_begin_rps(
1065+
datasource_type=datasource_type,
1066+
datasource=datasource,
1067+
policy=policy,
1068+
measurement=measurement,
1069+
job=job,
1070+
alias=alias,
1071+
),
1072+
1073+
operations.txn_commit_rps(
1074+
datasource_type=datasource_type,
1075+
datasource=datasource,
1076+
policy=policy,
1077+
measurement=measurement,
1078+
job=job,
1079+
alias=alias,
1080+
),
1081+
1082+
operations.txn_rollback_rps(
1083+
datasource_type=datasource_type,
1084+
datasource=datasource,
1085+
policy=policy,
1086+
measurement=measurement,
1087+
job=job,
1088+
alias=alias,
1089+
),
10631090
],
10641091

10651092
crud(datasource_type, datasource, policy=null, measurement=null, job=null, alias=null):: [

example_cluster/project/generate_load.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ local UPDATE = 'update'
5454
local UPSERT = 'upsert'
5555
local REPLACE = 'replace'
5656
local DELETE = 'delete'
57+
local COMMIT = 'commit'
58+
local ROLLBACK = 'rollback'
5759

5860
local last_key = 1
5961

@@ -117,6 +119,20 @@ local function space_operations(instance, operation, count)
117119
if tuple == nil then return end
118120
space:delete{ tuple[1] }
119121
end
122+
123+
elseif operation == COMMIT then
124+
for _ = 1, count do
125+
local s = instance.net_box:new_stream()
126+
s:begin()
127+
s:commit()
128+
end
129+
130+
elseif operation == ROLLBACK then
131+
for _ = 1, count do
132+
local s = instance.net_box:new_stream()
133+
s:begin()
134+
s:rollback()
135+
end
120136
end
121137
end
122138
end
@@ -134,6 +150,8 @@ local function generate_space_load(name, instance)
134150
space_load[UPSERT] = math.random(5, 10)
135151
space_load[REPLACE] = math.random(5, 10)
136152
space_load[DELETE] = math.random(1, 2)
153+
space_load[COMMIT] = math.random(1, 5)
154+
space_load[ROLLBACK] = math.random(0, 2)
137155
end
138156
else
139157
space_load[INSERT] = math.random(1, 3)

supported_metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Based on [tarantool/metrics 0.16.0](https://github.com/tarantool/metrics/release
7676
- [x] **tnt_net_requests_in_progress_current**: see *Tarantool network activity/Requests in progress* panel ([#133](https://github.com/tarantool/grafana-dashboard/issues/133))
7777
- [x] **tnt_net_requests_in_stream_queue_total**: see *Tarantool network activity/Requests in queue (overall)* panel ([#133](https://github.com/tarantool/grafana-dashboard/issues/133))
7878
- [x] **tnt_net_requests_in_stream_queue_current**: see *Tarantool network activity/Requests in queue (current)* panel ([#133](https://github.com/tarantool/grafana-dashboard/issues/133))
79-
- [ ] **tnt_stats_op_total**: see *Cluster overview/Overall space load* panel (Prometheus only), *Tarantool operations statistics/SELECT space requests*, *Tarantool operations statistics/INSERT space requests*, *Tarantool operations statistics/REPLACE space requests*, *Tarantool operations statistics/UPSERT space requests*, *Tarantool operations statistics/UPDATE space requests*, *Tarantool operations statistics/DELETE space requests*, *Tarantool operations statistics/Call requests*, *Tarantool operations statistics/Eval calls*, *Tarantool operations statistics/Request errors*, *Tarantool operations statistics/Authentication requests*, *Tarantool operations statistics/SQL prepare calls*, *Tarantool operations statistics/SQL execute calls* panels ([386be0a6](https://github.com/tarantool/grafana-dashboard/commit/386be0a6bc0848c0f23a19a09dd983dc42df0b9b), [#66](https://github.com/tarantool/grafana-dashboard/issues/66), [#176](https://github.com/tarantool/grafana-dashboard/issues/176))
79+
- [x] **tnt_stats_op_total**: see *Cluster overview/Overall space load* panel (Prometheus only), *Tarantool operations statistics/SELECT space requests*, *Tarantool operations statistics/INSERT space requests*, *Tarantool operations statistics/REPLACE space requests*, *Tarantool operations statistics/UPSERT space requests*, *Tarantool operations statistics/UPDATE space requests*, *Tarantool operations statistics/DELETE space requests*, *Tarantool operations statistics/Call requests*, *Tarantool operations statistics/Eval calls*, *Tarantool operations statistics/Request errors*, *Tarantool operations statistics/Authentication requests*, *Tarantool operations statistics/SQL prepare calls*, *Tarantool operations statistics/SQL execute calls*, *Tarantool operations statistics/Transaction begins*, *Tarantool operations statistics/Transaction commits*, *Tarantool operations statistics/Transaction rollbacks* panels ([386be0a6](https://github.com/tarantool/grafana-dashboard/commit/386be0a6bc0848c0f23a19a09dd983dc42df0b9b), [#66](https://github.com/tarantool/grafana-dashboard/issues/66), [#176](https://github.com/tarantool/grafana-dashboard/issues/176))
8080
- **tnt_stats_op_rps**: unsupported (deprecated, superseded by **tnt_stats_op_total**)
8181
- **tnt_replication_lsn**: unsupported (decided not to support: doesn't seem useful for visualization)
8282
- **tnt_replication_replica_\*_lsn**: unsupported (deprecated, superseded by **tnt_replication_lsn**)

0 commit comments

Comments
 (0)