Skip to content

Commit 82ae335

Browse files
DifferentialOrangevasiliy-t
authored andcommitted
Add slab memory panels (similar to slab ratio)
1 parent 779d23a commit 82ae335

File tree

3 files changed

+976
-16
lines changed

3 files changed

+976
-16
lines changed

tarantool/dashboard.libsonnet

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,73 @@ dashboard
6161
version=''
6262
)
6363
.addPanel(
64-
grafana.row.new(title='memory'),
65-
{ x: 0, y: 0 }
64+
grafana.row.new(title='Tarantool memory overview'),
65+
{ w: 24, h: 1, x: 0, y: 0 }
6666
)
6767
.addPanel(
6868
slab.monitor_info(),
69-
{ w: 24, h: 3, x: 0, y: 0 }
69+
{ w: 24, h: 3, x: 0, y: 1 }
7070
)
7171
.addPanel(
7272
slab.quota_used_ratio(
7373
datasource=datasource,
7474
measurement=measurement,
7575
),
76-
{ w: 8, h: 8, x: 0, y: 3 }
76+
{ w: 8, h: 8, x: 0, y: 4 }
7777
)
7878
.addPanel(
7979
slab.arena_used_ratio(
8080
datasource=datasource,
8181
measurement=measurement,
8282
),
83-
{ w: 8, h: 8, x: 8, y: 3 },
83+
{ w: 8, h: 8, x: 8, y: 4 },
8484
)
8585
.addPanel(
8686
slab.items_used_ratio(
8787
datasource=datasource,
8888
measurement=measurement,
8989
),
90-
{ w: 8, h: 8, x: 16, y: 3 },
90+
{ w: 8, h: 8, x: 16, y: 4 },
91+
)
92+
.addPanel(
93+
slab.quota_used(
94+
datasource=datasource,
95+
measurement=measurement,
96+
),
97+
{ w: 8, h: 8, x: 0, y: 12 }
98+
)
99+
.addPanel(
100+
slab.arena_used(
101+
datasource=datasource,
102+
measurement=measurement,
103+
),
104+
{ w: 8, h: 8, x: 8, y: 12 },
105+
)
106+
.addPanel(
107+
slab.items_used(
108+
datasource=datasource,
109+
measurement=measurement,
110+
),
111+
{ w: 8, h: 8, x: 16, y: 12 },
112+
)
113+
.addPanel(
114+
slab.quota_size(
115+
datasource=datasource,
116+
measurement=measurement,
117+
),
118+
{ w: 8, h: 8, x: 0, y: 20 }
119+
)
120+
.addPanel(
121+
slab.arena_size(
122+
datasource=datasource,
123+
measurement=measurement,
124+
),
125+
{ w: 8, h: 8, x: 8, y: 20 },
126+
)
127+
.addPanel(
128+
slab.items_size(
129+
datasource=datasource,
130+
measurement=measurement,
131+
),
132+
{ w: 8, h: 8, x: 16, y: 20 },
91133
)

tarantool/slab.libsonnet

Lines changed: 134 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ local influxdb = grafana.influxdb;
1616
|||,
1717
),
1818

19-
local used_ratio(
19+
local used_panel(
2020
title,
2121
description,
2222
datasource,
2323
measurement,
2424
metric_name,
25+
format,
26+
labelY1
2527
) = graph.new(
2628
title=title,
2729
description=description,
2830
datasource=datasource,
2931

30-
format='percent',
31-
labelY1='used ratio',
32+
format=format,
33+
labelY1=labelY1,
3234
fill=0,
3335
decimals=2,
3436
sort='decreasing',
@@ -45,6 +47,22 @@ local influxdb = grafana.influxdb;
4547
).where('metric_name', '=', metric_name).selectField('value').addConverter('mean')
4648
),
4749

50+
local used_ratio(
51+
title,
52+
description,
53+
datasource,
54+
measurement,
55+
metric_name,
56+
) = used_panel(
57+
title,
58+
description,
59+
datasource,
60+
measurement,
61+
metric_name,
62+
format='percent',
63+
labelY1='used ratio'
64+
),
65+
4866
quota_used_ratio(
4967
title='Used by slab allocator (quota_used_ratio)',
5068
description=|||
@@ -86,7 +104,7 @@ local influxdb = grafana.influxdb;
86104
),
87105

88106
items_used_ratio(
89-
title='Used only for tuples (items_used_ratio)',
107+
title='Used for tuples (items_used_ratio)',
90108
description=|||
91109
`items_used_ratio` = `items_used` / `items_size`.
92110
@@ -104,4 +122,116 @@ local influxdb = grafana.influxdb;
104122
measurement=measurement,
105123
metric_name='tnt_slab_items_used_ratio',
106124
),
125+
126+
local used_memory(
127+
title,
128+
description,
129+
datasource,
130+
measurement,
131+
metric_name,
132+
) = used_panel(
133+
title,
134+
description,
135+
datasource,
136+
measurement,
137+
metric_name,
138+
format='bytes',
139+
labelY1='in bytes',
140+
),
141+
142+
quota_used(
143+
title='Used by slab allocator (quota_used)',
144+
description=|||
145+
Memory used by slab allocator (for both tuple and index slabs).
146+
|||,
147+
148+
datasource=null,
149+
measurement=null,
150+
):: used_memory(
151+
title=title,
152+
description=description,
153+
datasource=datasource,
154+
measurement=measurement,
155+
metric_name='tnt_slab_quota_used',
156+
),
157+
158+
quota_size(
159+
title='Slab allocator memory limit (quota_size)',
160+
description=|||
161+
Memory limit for slab allocator (as configured in the *memtx_memory* parameter).
162+
|||,
163+
164+
datasource=null,
165+
measurement=null,
166+
):: used_memory(
167+
title=title,
168+
description=description,
169+
datasource=datasource,
170+
measurement=measurement,
171+
metric_name='tnt_slab_quota_size',
172+
),
173+
174+
arena_used(
175+
title='Used for tuples and indexes (arena_used)',
176+
description=|||
177+
Memory used for both tuples and indexes.
178+
|||,
179+
180+
datasource=null,
181+
measurement=null,
182+
):: used_memory(
183+
title=title,
184+
description=description,
185+
datasource=datasource,
186+
measurement=measurement,
187+
metric_name='tnt_slab_arena_used',
188+
),
189+
190+
arena_size(
191+
title='Allocated for tuples and indexes (arena_size)',
192+
description=|||
193+
Memory allocated for both tuples and indexes by slab allocator.
194+
|||,
195+
196+
datasource=null,
197+
measurement=null,
198+
):: used_memory(
199+
title=title,
200+
description=description,
201+
datasource=datasource,
202+
measurement=measurement,
203+
metric_name='tnt_slab_arena_size',
204+
),
205+
206+
items_used(
207+
title='Used for tuples (items_used)',
208+
description=|||
209+
Memory used for only tuples.
210+
|||,
211+
212+
datasource=null,
213+
measurement=null,
214+
):: used_memory(
215+
title=title,
216+
description=description,
217+
datasource=datasource,
218+
measurement=measurement,
219+
metric_name='tnt_slab_items_used',
220+
),
221+
222+
items_size(
223+
title='Allocated for tuples (items_size)',
224+
description=|||
225+
Memory allocated for only tuples by slab allocator.
226+
|||,
227+
228+
datasource=null,
229+
measurement=null,
230+
):: used_memory(
231+
title=title,
232+
description=description,
233+
datasource=datasource,
234+
measurement=measurement,
235+
metric_name='tnt_slab_items_size',
236+
),
107237
}

0 commit comments

Comments
 (0)