Skip to content

Commit 90d80a3

Browse files
Add Lua memory panel and memory miscellaneous row
Closes #54
1 parent cc5d3ba commit 90d80a3

File tree

8 files changed

+379
-34
lines changed

8 files changed

+379
-34
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
## Added
10+
- Memory miscellaneous row with Lua memory panel
11+
12+
## Changed
13+
- Rename memory overview row
14+
715
## [0.2.2] - 2021-01-28
816
Grafana revisions: [Prometheus revision 3](https://grafana.com/api/dashboards/13054/revisions/3/download)
917

-109 KB
Loading
-12.5 KB
Loading
49 KB
Loading

tarantool/dashboard.libsonnet

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local grafana = import 'grafonnet/grafana.libsonnet';
22

33
local http = import 'http.libsonnet';
4+
local memory_misc = import 'memory_misc.libsonnet';
45
local slab = import 'slab.libsonnet';
56
local space = import 'space.libsonnet';
67
local row = grafana.row;
@@ -96,7 +97,7 @@ local row = grafana.row;
9697
{ w: 8, h: 8, x: 16, y: 9 + offset },
9798
)
9899
.addPanel(
99-
row.new(title='Tarantool memory overview'),
100+
row.new(title='Tarantool memory allocation overview'),
100101
{ w: 24, h: 1, x: 0, y: 17 + offset }
101102
)
102103
.addPanel(
@@ -185,9 +186,22 @@ local row = grafana.row;
185186
{ w: 8, h: 8, x: 16, y: 37 + offset },
186187
)
187188
.addPanel(
188-
row.new(title='Tarantool spaces statistics'),
189+
row.new(title='Tarantool memory miscellaneous'),
189190
{ w: 24, h: 1, x: 0, y: 45 + offset }
190191
)
192+
.addPanel(
193+
memory_misc.lua_memory(
194+
datasource=datasource,
195+
policy=policy,
196+
measurement=measurement,
197+
job=job,
198+
),
199+
{ w: 24, h: 8, x: 0, y: 46 + offset },
200+
)
201+
.addPanel(
202+
row.new(title='Tarantool spaces statistics'),
203+
{ w: 24, h: 1, x: 0, y: 54 + offset }
204+
)
191205
.addPanel(
192206
space.select_rps(
193207
datasource=datasource,
@@ -196,7 +210,7 @@ local row = grafana.row;
196210
job=job,
197211
rate_time_range=rate_time_range,
198212
),
199-
{ w: 8, h: 8, x: 0, y: 46 + offset },
213+
{ w: 8, h: 8, x: 0, y: 55 + offset },
200214
)
201215
.addPanel(
202216
space.insert_rps(
@@ -206,7 +220,7 @@ local row = grafana.row;
206220
job=job,
207221
rate_time_range=rate_time_range,
208222
),
209-
{ w: 8, h: 8, x: 8, y: 46 + offset },
223+
{ w: 8, h: 8, x: 8, y: 55 + offset },
210224
)
211225
.addPanel(
212226
space.replace_rps(
@@ -216,7 +230,7 @@ local row = grafana.row;
216230
job=job,
217231
rate_time_range=rate_time_range,
218232
),
219-
{ w: 8, h: 8, x: 16, y: 46 + offset },
233+
{ w: 8, h: 8, x: 16, y: 55 + offset },
220234
)
221235
.addPanel(
222236
space.upsert_rps(
@@ -226,7 +240,7 @@ local row = grafana.row;
226240
job=job,
227241
rate_time_range=rate_time_range,
228242
),
229-
{ w: 8, h: 8, x: 0, y: 46 + offset },
243+
{ w: 8, h: 8, x: 0, y: 63 + offset },
230244
)
231245
.addPanel(
232246
space.update_rps(
@@ -236,7 +250,7 @@ local row = grafana.row;
236250
job=job,
237251
rate_time_range=rate_time_range,
238252
),
239-
{ w: 8, h: 8, x: 8, y: 46 + offset },
253+
{ w: 8, h: 8, x: 8, y: 63 + offset },
240254
)
241255
.addPanel(
242256
space.delete_rps(
@@ -246,6 +260,6 @@ local row = grafana.row;
246260
job=job,
247261
rate_time_range=rate_time_range,
248262
),
249-
{ w: 8, h: 8, x: 16, y: 46 + offset },
263+
{ w: 8, h: 8, x: 16, y: 63 + offset },
250264
),
251265
}

tarantool/memory_misc.libsonnet

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
local grafana = import 'grafonnet/grafana.libsonnet';
2+
3+
local graph = grafana.graphPanel;
4+
local influxdb = grafana.influxdb;
5+
local prometheus = grafana.prometheus;
6+
7+
{
8+
local memory_panel(
9+
title,
10+
description,
11+
datasource,
12+
policy,
13+
measurement,
14+
job,
15+
metric_name,
16+
) = graph.new(
17+
title=title,
18+
description=description,
19+
datasource=datasource,
20+
21+
format='bytes',
22+
labelY1='in bytes',
23+
fill=0,
24+
decimals=2,
25+
sort='decreasing',
26+
legend_alignAsTable=true,
27+
legend_current=true,
28+
legend_values=true,
29+
legend_sort='current',
30+
legend_sortDesc=true,
31+
).addTarget(
32+
if datasource == '${DS_PROMETHEUS}' then
33+
prometheus.target(
34+
expr=std.format('%s{job=~"%s"}', [metric_name, job]),
35+
legendFormat='{{alias}}',
36+
)
37+
else if datasource == '${DS_INFLUXDB}' then
38+
influxdb.target(
39+
policy=policy,
40+
measurement=measurement,
41+
group_tags=['label_pairs_alias'],
42+
alias='$tag_label_pairs_alias',
43+
).where('metric_name', '=', metric_name).selectField('value').addConverter('mean')
44+
),
45+
46+
lua_memory(
47+
title='Lua runtime',
48+
description=|||
49+
Memory used for the Lua runtime. Lua memory is bounded by 2 GB per instance.
50+
|||,
51+
datasource=null,
52+
policy=null,
53+
measurement=null,
54+
job=null,
55+
):: memory_panel(
56+
title=title,
57+
description=description,
58+
datasource=datasource,
59+
policy=policy,
60+
measurement=measurement,
61+
job=job,
62+
metric_name='tnt_info_memory_lua',
63+
),
64+
}

0 commit comments

Comments
 (0)